winemac: Don't use the main dispatch queue to implement OnMainThread() for a thread with no event queue.

Ken Thomases ken at codeweavers.com
Wed Oct 30 05:52:58 CDT 2013


The main dispatch queue is a serial queue and is a shared resource.  If we
submit a long-running task to it, then no other tasks, including those submitted
by the system frameworks, can run until it completes.

This differs from the run-loop source we use for OnMainThreadAsync() since
run loops can be nested.

So we use OnMainThreadAsync() and its run-loop source to submit the task to the
main thread for both cases.  When we don't have a queue to wait on, we just use
a semaphore to wait for the task to complete.
---
dlls/winemac.drv/cocoa_event.m |   49 +++++++++++++++++++++++++--------------
1 files changed, 31 insertions(+), 18 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winemac-Don-t-use-the-main-dispatch-queue-to-impleme.patch
Type: text/x-patch
Size: 2381 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20131030/cde3631f/attachment.bin>


More information about the wine-patches mailing list