#include <windows.h>
#include <iostream.h>
void main() {
HANDLE mtx=CreateMutex(NULL,FALSE,"NTSBBMTK"); cout«"Attempting mutex\n"; cout. flush () ;
WaitForSingleObject(mtx,INFINITE); cout«"Mutex acguired! \n" ; cout. flush () ;
MessageBox (NULL,"Acguired mutex","MUTEX",MB_OK); ReleaseMutex (mt::) ;
Cios eHandle(mtx);
}
© Marek Nowak
Programowanie współbieżne w systemach operacyjnych Windows NT/2000