aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-03-04 02:00:13 -0800
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:25 +0200
commit3d37513eb81325cef80eada39dbdb812c9c627d5 (patch)
treefb2dbb60e6f397347b7cb903ffd648e99baf850e /nx-X11/lib
parente8e91b69e83da81b3d8d71139a99c13d7a62ba00 (diff)
downloadnx-libs-3d37513eb81325cef80eada39dbdb812c9c627d5.tar.gz
nx-libs-3d37513eb81325cef80eada39dbdb812c9c627d5.tar.bz2
nx-libs-3d37513eb81325cef80eada39dbdb812c9c627d5.zip
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 <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/locking.c2
1 files changed, 2 insertions, 0 deletions
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();