Anonymous user
Mutex: Difference between revisions
m
→Win32: whitespace
m (→{{header|Java}}: Adding a throws for compilability) |
m (→Win32: whitespace) |
||
Line 69:
{{works with|Win32}}
To create a mutex operating system "object":
▲ HANDLE hMutex = CreateMutex(NULL, FALSE, NULL);
To lock the mutex:
▲ WaitForSingleObject(hMutex, INFINITE);
To unlock the mutex
<lang c>ReleaseMutex(hMutex);</lang>
When the program is finished with the mutex:
<lang c>CloseHandle(hMutex);</lang>
===POSIX===
|