Zhiyi Zhang (@zhiyi) commented about dlls/rtworkq/queue.c:
{
/* This means the callback wasn't run during our wait, so we can invoke the
* callback with a canceled status, and release the work item. */
if ((key & WAIT_ITEM_KEY_MASK) == WAIT_ITEM_KEY_MASK)
{
IRtwqAsyncResult_SetStatus(item->result, RTWQ_E_OPERATION_CANCELLED);
invoke_async_callback(item->result);
}
IUnknown_Release(&item->IUnknown_iface);
}
}IUnknown_Release(&item->IUnknown_iface); hr = S_OK; break; }
- LeaveCriticalSection(&queue->cs);
If key is not found, queue->cs is not released.