Asynchron locking of a semaphore
Source position: exec.pas line 1822
function Procure( |
SigSem: PSignalSemaphore; |
BidMessage: PSemaphoreMessage |
):LongBool; |
SigSem |
|
The SignalSemaphore that you wish to lock |
This function is used to obtain a semaphore in an async manner. Like ObtainSemaphore(), it will obtain a SignalSemaphore for you but unlike ObtainSemaphore(), you will not block until you get the semaphore. Procure() will just post a request for the semaphore and will return. When the semaphore is available (which could be at any time) the bidMessage will ReplyMsg() and you will own the semaphore. This lets you wait on multiple semaphores at once and to continue processing while waiting for the semaphore.
|
Get a List of semaphores |
|
|
Initialize a signal semaphore |
|
|
Make signal semaphore available to others |
|
|
Try to obtain a Semaphore without blocking |
|
|
Gain exclusive access to a semaphore |
|
|
Gain access to a semaphore in shared mode |
|
|
Release a bidMessage from Procure() |