c++ - 从 GetQueuedCompletionStatus 解除阻止

标签 c++ c multithreading winsock2 resource-cleanup

在程序终止期间,如何取消阻止先前通过调用 GetQueuedCompletionStatus() 被阻止的线程?

最佳答案

您可以使用 PostQueuedCompletionStatus API 调用将终止消息发布到 IO 完成端口,或者使用 CloseHandle 简单地关闭 IOCP 句柄。

If a call to GetQueuedCompletionStatus fails because the completion port handle associated with it is closed while the call is outstanding, the function returns FALSE, *lpOverlapped will be NULL, and GetLastError will return ERROR_ABANDONED_WAIT_0.

关于c++ - 从 GetQueuedCompletionStatus 解除阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38559905/

相关文章:

c# - 我对C#线程池的理解正确吗?

c++ - 派生类私有(private)方法被调用

c++ - 具有某些不会在逻辑上定义的属性的类的概念

c++ - 将字符串解析为字符指针数组: char[0] contains the full string and [1] onward contains nothing

c - 位域的可用性

java - 同步属性读取为非同步属性

c++ - 如何迭代 long long 的二进制掩码?

c - 查找与一个字符串的结尾和下一个字符串的开头相匹配的最长子字符串

c - 在 C 语言中搜索参数中的单词

python - 打开 .exe 并通过 Python 子进程向其传递命令?