KKlouzal
KKlouzal

Reputation: 722

Unblock From GetQueuedCompletionStatus

During program termination, how do you unblock a thread that has been previously blocked with a call to GetQueuedCompletionStatus()?

Upvotes: 2

Views: 266

Answers (1)

Ari0nhh
Ari0nhh

Reputation: 5920

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 returns FALSE, *lpOverlapped will be NULL, and GetLastError will return ERROR_ABANDONED_WAIT_0.

Upvotes: 4

Related Questions