If we have not actually put the buffer back, deferred invariants may not hold. This is OK.

This commit is contained in:
Jamey Sharp 2006-02-21 15:33:05 -08:00
parent 434bf80b40
commit 67d06e0fe4

View file

@ -41,11 +41,17 @@ static void _XUnlockDisplay(Display *dpy)
{
--dpy->xcl->lock_count;
_XPutXCBBufferIf(dpy, _XBufferUnlocked);
assert(XCBGetRequestSent(XCBConnectionOfDisplay(dpy)) == dpy->request);
/* Traditional Xlib does this in _XSend; see the Xlib/XCB version
* of that function for why we do it here instead. */
_XSetSeqSyncFunction(dpy);
/* If we're unlocking all the way, make sure that our deferred
* invariants hold. */
if(!dpy->xcl->lock_count)
{
assert(XCBGetRequestSent(XCBConnectionOfDisplay(dpy)) == dpy->request);
/* Traditional Xlib does this in _XSend; see the Xlib/XCB version
* of that function for why we do it here instead. */
_XSetSeqSyncFunction(dpy);
}
pthread_mutex_unlock(XCBGetIOLock(XCBConnectionOfDisplay(dpy)));
}