summaryrefslogtreecommitdiff
path: root/dist/libxcb/src/xcb_out.c
diff options
context:
space:
mode:
Diffstat (limited to 'dist/libxcb/src/xcb_out.c')
-rw-r--r--dist/libxcb/src/xcb_out.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dist/libxcb/src/xcb_out.c b/dist/libxcb/src/xcb_out.c
index c9593e5f2..a4fe823b3 100644
--- a/dist/libxcb/src/xcb_out.c
+++ b/dist/libxcb/src/xcb_out.c
@@ -31,7 +31,11 @@
#include <assert.h>
#include <stdlib.h>
+#ifdef _WIN32
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <string.h>
#include "xcb.h"
@@ -443,6 +447,7 @@ int _xcb_out_init(_xcb_out *out)
out->request = 0;
out->request_written = 0;
+ out->request_expected_written = 0;
if(pthread_mutex_init(&out->reqlenlock, 0))
return 0;
@@ -453,8 +458,9 @@ int _xcb_out_init(_xcb_out *out)
void _xcb_out_destroy(_xcb_out *out)
{
- pthread_cond_destroy(&out->cond);
pthread_mutex_destroy(&out->reqlenlock);
+ pthread_cond_destroy(&out->cond);
+ pthread_cond_destroy(&out->socket_cond);
}
int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count)
@@ -463,6 +469,7 @@ int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count)
while(ret && count)
ret = _xcb_conn_wait(c, &c->out.cond, &vector, &count);
c->out.request_written = c->out.request;
+ c->out.request_expected_written = c->in.request_expected;
pthread_cond_broadcast(&c->out.cond);
_xcb_in_wake_up_next_reader(c);
return ret;