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.

This commit is contained in:
Jamey Sharp 2006-02-23 15:29:40 -08:00
parent a736674943
commit 26ac6292ba
2 changed files with 2 additions and 5 deletions

View File

@ -28,11 +28,7 @@
unsigned int XCBGetRequestSent(XCBConnection *c) unsigned int XCBGetRequestSent(XCBConnection *c)
{ {
unsigned int ret; return c->out.request;
pthread_mutex_lock(&c->iolock);
ret = c->out.request;
pthread_mutex_unlock(&c->iolock);
return ret;
} }
pthread_mutex_t *XCBGetIOLock(XCBConnection *c) pthread_mutex_t *XCBGetIOLock(XCBConnection *c)

View File

@ -31,6 +31,7 @@
#include <pthread.h> #include <pthread.h>
#include "xcb.h" #include "xcb.h"
/* This function must be called with the IOLock held. */
unsigned int XCBGetRequestSent(XCBConnection *c); unsigned int XCBGetRequestSent(XCBConnection *c);
pthread_mutex_t *XCBGetIOLock(XCBConnection *c); pthread_mutex_t *XCBGetIOLock(XCBConnection *c);