During program termination, how do you unblock a thread that has been previously blocked with a call to GetQueuedCompletionStatus()
?
You could post termination message to the IO completion port using PostQueuedCompletionStatus
API call or simply close IOCP
handle using CloseHandle
.
If a call to
GetQueuedCompletionStatus
fails because the completion port handle associated with it is closed while the call is outstanding, the function returnsFALSE
,*lpOverlapped
will beNULL
, andGetLastError
will returnERROR_ABANDONED_WAIT_0
.