Parameters
shandle | identifier (handle) of an opened semaphore |
tm | milliseconds count |
Since version:
6.1
Description
If the semaphore specified by the shandle parameter is opened, the function will immediately terminate and return 0. If the semaphore is down, the function will wait for the semaphore to get opened by another thread. The waiting thread has the state value equal to 8 in the client list. The wait state may end in one of the 3 ways:
Release_semaphore
function on the same semaphore, the function will end and return 0;Operation_limits
API function), the function will end and return -2. The time limit se set in milliseconds. If you set -1 here, the function can wait indefinitely.
If the function returns -2, the thread should return its activity ASAP.
See more about thread synchronization.
See