diff options
author | Jamey Sharp <jamey@minilop.net> | 2008-03-14 12:08:58 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2008-10-29 15:40:41 -0700 |
commit | 059ca642c76639fee958dc6054070de85e257e98 (patch) | |
tree | c6b2f6780b5f92269861cfb77717c7972e0478e0 /src/xcb_in.c | |
parent | d989656cde2ee7a4a66b2065209ef389495f3452 (diff) |
Inline _xcb_lock_io, _xcb_unlock_io, and _xcb_wait_io.
These functions are once again a single pthread call, so just make that
call directly.
Diffstat (limited to 'src/xcb_in.c')
-rw-r--r-- | src/xcb_in.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/xcb_in.c b/src/xcb_in.c index f613772..a0e5e10 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -341,7 +341,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_ if(c->has_error) return 0; - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); /* If this request has not been written yet, write it. */ if(_xcb_out_flush_to(c, request)) @@ -381,7 +381,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_ } wake_up_next_reader(c); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -396,9 +396,9 @@ int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, return 1; /* would not block */ } assert(reply != 0); - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); ret = poll_for_reply(c, request, reply, error); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -407,14 +407,14 @@ xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c) xcb_generic_event_t *ret; if(c->has_error) return 0; - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); /* get_event returns 0 on empty list. */ while(!(ret = get_event(c))) if(!_xcb_conn_wait(c, &c->in.event_cond, 0, 0)) break; wake_up_next_reader(c); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -423,12 +423,12 @@ xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c) xcb_generic_event_t *ret = 0; if(!c->has_error) { - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); /* FIXME: follow X meets Z architecture changes. */ ret = get_event(c); if(!ret && _xcb_in_read(c)) /* _xcb_in_read shuts down the connection on error */ ret = get_event(c); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); } return ret; } |