System.SyncObjs.TSemaphore.Release

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Release; overload; override;
function Release(AReleaseCount: Integer): Integer; reintroduce; overload;

C++

virtual void __fastcall Release()/* overload */;
HIDESBASE int __fastcall Release(int AReleaseCount)/* overload */;

Properties

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

Description

Releases one lock or several locks on the semaphore.

Call Release from a thread that has finished using one or more units of a shared resource.

The Release method releases one or several locks on the semaphore. If several locks are to be freed, they are specified through the AReleaseCount parameter.

If the number of free units of the shared resource plus the value of the AReleaseCount parameter exceeds the number of available units of the shared resource, specified through the AMaximumCount parameter of the constructor, then the semaphore counter variable is left unchanged and the Release function raises an error.

See Also