Wait_for_semaphore

sql

FUNCTION Wait_for_semaphore(IN shandle HANDLE, IN tm INT) RETURNS INT;

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:

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