Increases the value of a given semaphore object by a specified amount.
Kernel.bdh
ReleaseSemaphore(in hSemaphore : number, in nIncrease : number, out nValue : number optional): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hSemaphore | Handle to a semaphore object |
nIncrease | Amount by which the semaphore object's current value is increased |
nValue | Variable receiving the semaphore object's value before the value is incremented (optional) |
dcltrans transaction TMain const MAX_USERS := 25; var hSemaphore: number; begin hSemaphore := CreateSemaphore(NULL, MAX_USERS, MAX_USERS, "semaphore"); ... WaitForSingleObject(hSemaphore, INFINITE); // perform critical work ... ReleaseSemaphore(hSemaphore, 1); ... end TMain;