System.SyncObjs.TSemaphore.Acquire

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Acquire; override;

C++

virtual void __fastcall Acquire();

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.SyncObjs.pas
System.SyncObjs.hpp
System.SyncObjs TSemaphore

Description

Attempts to acquire a lock on the semaphore.

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.

See Also