Unit 'exec' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

Procure

Asynchron locking of a semaphore

Declaration

Source position: exec.pas line 1822

function Procure(

  SigSem: PSignalSemaphore;

  BidMessage: PSemaphoreMessage

):LongBool;

Arguments

SigSem

  

The SignalSemaphore that you wish to lock

Description

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.

See also

ObtainSemaphoreList

  

Get a List of semaphores

InitSemaphore

  

Initialize a signal semaphore

ReleaseSemaphore

  

Make signal semaphore available to others

AttemptSemaphore

  

Try to obtain a Semaphore without blocking

ObtainSemaphore

  

Gain exclusive access to a semaphore

ObtainSemaphoreShared

  

Gain access to a semaphore in shared mode

Vacate

  

Release a bidMessage from Procure()


Documentation generated on: 2021-07-30