public bool SyncSemaphore::lock    ([ int $wait = -1  ] )

SyncSemaphore::lockDecreases the count of the semaphore or waits

wait

The number of milliseconds to wait for the semaphore. A value of -1 is infinite.