summaryrefslogtreecommitdiff
path: root/src/XlibInt.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-04-16 20:18:28 -0700
committerJamey Sharp <jamey@minilop.net>2010-04-18 01:28:38 -0700
commit933aee1d5c53b0cc7d608011a29188b594c8d70b (patch)
tree2ac0431b4b79b909c8e0564a0b8d134f0d44c325 /src/XlibInt.c
parentaab43278ae619eb57d2dd9c7396f460f078588fc (diff)
downloadxorg-lib-libX11-933aee1d5c53b0cc7d608011a29188b594c8d70b.tar.gz
Fix Xlib/XCB for multi-threaded applications (with caveats).
Rather than trying to group all response processing in one monolithic process_responses function, let _XEventsQueued, _XReadEvents, and _XReply each do their own thing with a minimum of code that can all be reasoned about independently. Tested with `ico -threads 20`, which seems to be able to make many icosahedrons dance at once quite nicely now. Caveats: - Anything that was not thread-safe in Xlib before XCB probably still isn't. XListFontsWithInfo, for instance. - If one thread is waiting for events and another thread tries to read a reply, both will hang until an event arrives. Previously, if this happened it might work sometimes, but otherwise would trigger either an assertion failure or a permanent hang. - Versions of libxcb up to and including 1.6 have a bug that can cause xcb_wait_for_event or xcb_wait_for_reply to hang if they run concurrently with xcb_writev or other writers. So you'll want that fix as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'src/XlibInt.c')
0 files changed, 0 insertions, 0 deletions