From: Jamey Sharp Date: Thu, 23 Feb 2006 23:29:40 +0000 (-0800) Subject: Minor performance fix: Change the contract on XCBGetRequestSent so that it does not... X-Git-Tag: 1.8.1~382 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26ac6292ba0535ac3747d23f2f4d284c4b5f42ba;p=profile%2Fivi%2Flibxcb.git Minor performance fix: Change the contract on XCBGetRequestSent so that it does not waste time re-locking. This is for Xlib, and Xlib has already locked. --- diff --git a/src/xcb_xlib.c b/src/xcb_xlib.c index 8cc6837..61518f7 100644 --- a/src/xcb_xlib.c +++ b/src/xcb_xlib.c @@ -28,11 +28,7 @@ unsigned int XCBGetRequestSent(XCBConnection *c) { - unsigned int ret; - pthread_mutex_lock(&c->iolock); - ret = c->out.request; - pthread_mutex_unlock(&c->iolock); - return ret; + return c->out.request; } pthread_mutex_t *XCBGetIOLock(XCBConnection *c) diff --git a/src/xcbxlib.h b/src/xcbxlib.h index e9f7140..59dd2a5 100644 --- a/src/xcbxlib.h +++ b/src/xcbxlib.h @@ -31,6 +31,7 @@ #include #include "xcb.h" +/* This function must be called with the IOLock held. */ unsigned int XCBGetRequestSent(XCBConnection *c); pthread_mutex_t *XCBGetIOLock(XCBConnection *c);