Huw Davies (@huw) commented about dlls/sapi/async.c:
- LeaveCriticalSection(&queue->cs);
- return task;
+}
+void async_empty_queue(struct async_queue *queue) +{
- struct list *ptr;
- EnterCriticalSection(&queue->cs);
- while ((ptr = list_head(&queue->tasks)))
- {
struct async_task *task = LIST_ENTRY(ptr, struct async_task, entry);
list_remove(&task->entry);
heap_free(task);
- }
We have `LIST_FOR_EACH_ENTRY_SAFE()` which is designed for this sort of thing.