- 头文件<windows.h>
- CreateThread()--CreateThread(NULL, 0, thread2, (void *)(&i), 0, NULL); 把i的地址传给thread2函数,可供调用
- CreateMutex()--CreateMutex(NULL, FALSE, L"mutex");
- CreateSemaphore()--CreateSemaphore(NULL, 0, 3, L"customer")
- WaitForSingleObject(param1,param2) param1可以是mutex,semaphore,event等等,param2是INFINITE,WAIT_TIMEOUT,WAIT_OBJECT_0,WAIT_OBANDONED
- ReleaseMutex(Mutex)
- ReleaseSemaphore()--ReleaseSemaphore(hCustomers, 1, NULL); 相当于up操作的+1
- Sleep(param) param是毫秒数
- CloseHandle(HANDLE)