RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSemaphore.Acquire Method

Attempts to acquire a lock on the semaphore.

Pascal
procedure Acquire; override;
C++
virtual __fastcall Acquire();

Call Acquire from the thread that needs to use some of a shared resource's units.  

The Acquire method waits until the semaphore becomes free, that is, the number of free units of the resource is nonzero. Then the Acquire method acquires a lock on the semaphore.  

If the semaphore is not free, then the calling thread is added to the semaphore waiting queue. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!