RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSemaphore.Release Method ()

Releases one lock or several locks on the semaphore.

Pascal
procedure Release; override; overload;
function Release(AReleaseCount: Integer): Integer; overload; reintroduce;
C++
virtual __fastcall Release();
__fastcall int Release(int AReleaseCount);

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. 

 

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