gpt4 book ai didi

windows - 为什么 WaitForSingleObject 会返回 WAIT_FAILED

转载 作者:可可西里 更新时间:2023-11-01 13:50:55 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com