From 3d37513eb81325cef80eada39dbdb812c9c627d5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 4 Mar 2012 02:00:13 -0800 Subject: Block for other threads in _XUserLockDisplay Wait for all other threads to release the user-level lock when acquiring it. This ensures that only one thread at a time holds the user-level lock, necessary as it is a nesting lock and a single variable is used to determine when the lock is nesting and when it is contended. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/locking.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nx-X11/lib/X11/locking.c b/nx-X11/lib/X11/locking.c index 4f9a40fbd..b3dfb3b01 100644 --- a/nx-X11/lib/X11/locking.c +++ b/nx-X11/lib/X11/locking.c @@ -486,6 +486,8 @@ static void _XInternalLockDisplay( static void _XUserLockDisplay( register Display* dpy) { + _XDisplayLockWait(dpy); + if (++dpy->lock->locking_level == 1) { dpy->lock->lock_wait = _XDisplayLockWait; dpy->lock->locking_thread = xthread_self(); -- cgit v1.2.3