wine/dlls/rtworkq
Zhiyi Zhang 7865026f53 rtworkq: Avoid possible scenarios that an async callback could be called twice.
Consider a thread A running waiting_item_cancelable_callback() and a thread B running queue_cancel_item(),
which is the scenario from canceling a work item right after it gets submitted by RtwqPutWaitingWorkItem().
When the invoke_async_callback() call in queue_cancel_item() for item key with WAIT_ITEM_KEY_MASK in
thread B runs before the queue_release_pending_item() in waiting_item_cancelable_callback() in thread
A, the async callback is called the first time in queue_cancel_item() with RTWQ_E_OPERATION_CANCELLED,
then a second time in waiting_item_cancelable_callback(). We should check in queue_release_pending_item()
whether an item is already removed by queue_cancel_item() before calling async callbacks.

A different scenario could happen for scheduled_item_cancelable_callback() with the function ends
up calling its async callback even after it has been canceled by queue_cancel_item().
2024-03-04 15:39:06 +01:00
..
tests makefiles: Always use the global SOURCES variable for .c files. 2023-11-01 22:44:03 +01:00
Makefile.in makefiles: Always use the global SOURCES variable for .c files. 2023-11-01 22:44:03 +01:00
queue.c rtworkq: Avoid possible scenarios that an async callback could be called twice. 2024-03-04 15:39:06 +01:00
rtworkq.spec