diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-10-09 12:32:05 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-10-09 12:37:48 -0700 |
commit | 3a74b5e7a1aab0619b7e34d90d2b8b2b1e386129 (patch) | |
tree | 40cc802e1e8f262a08f822212e7a79d23ed8f29a /src/xcb_out.c | |
parent | ee1bc1d28a1bda0526db90139edc1304d2ef3d7c (diff) |
xcb_request_check: Hold the I/O lock while deciding to sync.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Diffstat (limited to 'src/xcb_out.c')
-rw-r--r-- | src/xcb_out.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xcb_out.c b/src/xcb_out.c index fe71193..5eb1e42 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -343,6 +343,15 @@ int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count) return ret; } +void _xcb_out_send_sync(xcb_connection_t *c) +{ + /* wait for other writing threads to get out of my way. */ + while(c->out.writing) + pthread_cond_wait(&c->out.cond, &c->iolock); + get_socket_back(c); + send_sync(c); +} + int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request) { assert(XCB_SEQUENCE_COMPARE(request, <=, c->out.request)); |