Suppose that one of the threads read the posted operation, completed it and got to the work_finished function where it decremented outstanding_work to 0 and entered the stop function. Now the second thread starts. In the run function it sees that outstanding_work is 0 so it sets stopped to 1 and returns. Back in the first thread PostQueuedCompletionStatus?(iocp_.handle, 0, 0, 0) isn't called since stopped is already 1. do_one returns 1 and is called again. GetQueuedCompletionStatus? returns WAIT_TIMEOUT because the operation queue is empty, which causes the loop to continue to the next iteration ad infinitum.