T.T*_*.T. 4 c c++ windows winapi synchronization
使用WaitForSingleObject函数.
如果调用该函数并超时,是否仍需要释放互斥锁?
即,ReleaseMutex应该处于适当位置1.还是2.五秒钟过去?
WaitForSingleObject(5 second time out)
{
//access shared resource
//1. - ReleaseMutex() here?
}
//2. - ReleaseMutex() here?
Run Code Online (Sandbox Code Playgroud)