Commit 3d37513e authored by Keith Packard's avatar Keith Packard Committed by Ulrich Sibiller

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: 's avatarKeith Packard <keithp@keithp.com> Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent e8e91b69
...@@ -486,6 +486,8 @@ static void _XInternalLockDisplay( ...@@ -486,6 +486,8 @@ static void _XInternalLockDisplay(
static void _XUserLockDisplay( static void _XUserLockDisplay(
register Display* dpy) register Display* dpy)
{ {
_XDisplayLockWait(dpy);
if (++dpy->lock->locking_level == 1) { if (++dpy->lock->locking_level == 1) {
dpy->lock->lock_wait = _XDisplayLockWait; dpy->lock->lock_wait = _XDisplayLockWait;
dpy->lock->locking_thread = xthread_self(); dpy->lock->locking_thread = xthread_self();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment