Uses the Win32 CreateMutexEx function to create a named mutex object. Mutex objects are used to serialize access to critical sections inside transactions for multiple concurrent users.
Kernel.bdh
CreateMutex( in sMtxName: string ): number;
handle to the mutex object
Parameter | Description |
---|---|
sMtxName | Name of the mutex object |
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;
mutex object created mutex object released handle to mutex object closed
MutexLogin.bdf