ReleaseMutex Function

Action

Releases ownership of the specified mutex object.

Include file

Kernel.bdh

Syntax

ReleaseMutex(in hMutex: number): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hMutex Handle of the mutex object

Example

dcltrans
transaction TCloseHandle
var
hMutex: number;
begin
hMutex := CreateMutex("MutexObject");
write("mutex object created"); writeln;
WaitForSingleObject(hMutex, INFINITE);
ReleaseMutex(hMutex);
write("mutex object released"); writeln;
CloseHandle(hMutex);
write("handle to mutex object closed"); writeln;
end TCloseHandle;

Output

mutex object created
mutex object released
handle to mutex object closed

Sample scripts

Trans.bdf, MutexLogin.bdf