MSDN 说
If the function fails, the return value is WAIT_FAILED. To get extended error information, call GetLastError.
代码是:
HANDLE m_mutex_handle; /**< m_mutex_handle. The handle to the created mutex. */
m_mutex_handle = ::CreateMutex( 0, false, NULL );
::WaitForSingleObject( m_mutex_handle, INFINITE );
但是可能发生的原因是什么?
最佳答案
如果您缺少对象的 SYNCHRONIZE 权限,那么您就等不及了。 WAIT_FAILED 将被返回。
关于windows - 为什么 WaitForSingleObject 会返回 WAIT_FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/210751/