Lines Matching refs:out

51     ++c->out.request;
53 c->in.request_expected = c->out.request;
55 _xcb_in_expect_reply(c, c->out.request, workaround, flags);
57 while(count && c->out.queue_len + vector[0].iov_len <= sizeof(c->out.queue))
59 memcpy(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len);
60 c->out.queue_len += vector[0].iov_len;
69 vector[0].iov_base = c->out.queue;
70 vector[0].iov_len = c->out.queue_len;
71 c->out.queue_len = 0;
93 while(c->out.return_socket && c->out.socket_moving)
94 pthread_cond_wait(&c->out.socket_cond, &c->iolock);
95 if(!c->out.return_socket)
98 c->out.socket_moving = 1;
100 c->out.return_socket(c->out.socket_closure);
102 c->out.socket_moving = 0;
104 pthread_cond_broadcast(&c->out.socket_cond);
105 c->out.return_socket = 0;
106 c->out.socket_closure = 0;
112 /* We're about to append data to out.queue, so we need to
120 * writing from out.queue, and so we can't stick data there.
131 if (!c->out.writing)
133 pthread_cond_wait(&c->out.cond, &c->iolock);
143 pthread_mutex_lock(&c->out.reqlenlock);
144 if(c->out.maximum_request_length_tag == LAZY_NONE)
150 c->out.maximum_request_length_tag = LAZY_COOKIE;
151 c->out.maximum_request_length.cookie = xcb_big_requests_enable(c);
155 c->out.maximum_request_length_tag = LAZY_FORCED;
156 c->out.maximum_request_length.value = c->setup->maximum_request_length;
159 pthread_mutex_unlock(&c->out.reqlenlock);
167 pthread_mutex_lock(&c->out.reqlenlock);
168 if(c->out.maximum_request_length_tag == LAZY_COOKIE)
170 xcb_big_requests_enable_reply_t *r = xcb_big_requests_enable_reply(c, c->out.maximum_request_length.cookie, 0);
171 c->out.maximum_request_length_tag = LAZY_FORCED;
174 c->out.maximum_request_length.value = r->maximum_request_length;
178 c->out.maximum_request_length.value = c->setup->maximum_request_length;
180 pthread_mutex_unlock(&c->out.reqlenlock);
181 return c->out.maximum_request_length.value;
194 * variable if another thread is currently writing (c->out.writing > 0).
198 * tries to send fds, too). Thanks to this, we can atomically write out FDs.
203 while (c->out.out_fd.nfd == XCB_MAX_PASS_FD && !c->has_error) {
204 /* XXX: if c->out.writing > 0, this releases the iolock and
207 _xcb_out_flush_to(c, c->out.request);
209 if (c->out.out_fd.nfd == XCB_MAX_PASS_FD) {
217 c->out.out_fd.fd[c->out.out_fd.nfd++] = fds[0];
331 while ((req->isvoid && c->out.request == c->in.request_expected + (1 << 16) - 2) ||
332 (unsigned int) (c->out.request + 1) == 0)
339 request = c->has_error ? 0 : c->out.request;
388 ret = _xcb_out_flush_to(c, c->out.request);
389 while (ret && c->out.request != c->out.request_written);
392 c->out.return_socket = return_socket;
393 c->out.socket_closure = closure;
395 /* c->out.request + 1 will be the first request sent by the external
400 _xcb_in_expect_reply(c, c->out.request + 1, WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
402 assert(c->out.request == c->out.request_written);
403 *sent = c->out.request;
415 c->out.request += requests;
427 ret = _xcb_out_flush_to(c, c->out.request);
434 int _xcb_out_init(_xcb_out *out)
436 if(pthread_cond_init(&out->socket_cond, 0))
438 out->return_socket = 0;
439 out->socket_closure = 0;
440 out->socket_moving = 0;
442 if(pthread_cond_init(&out->cond, 0))
444 out->writing = 0;
446 out->queue_len = 0;
448 out->request = 0;
449 out->request_written = 0;
450 out->request_expected_written = 0;
452 if(pthread_mutex_init(&out->reqlenlock, 0))
454 out->maximum_request_length_tag = LAZY_NONE;
459 void _xcb_out_destroy(_xcb_out *out)
461 pthread_mutex_destroy(&out->reqlenlock);
462 pthread_cond_destroy(&out->cond);
463 pthread_cond_destroy(&out->socket_cond);
470 ret = _xcb_conn_wait(c, &c->out.cond, &vector, &count);
471 c->out.request_written = c->out.request;
472 c->out.request_expected_written = c->in.request_expected;
473 pthread_cond_broadcast(&c->out.cond);
486 assert(XCB_SEQUENCE_COMPARE(request, <=, c->out.request));
487 if(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request))
489 if(c->out.queue_len)
492 vec.iov_base = c->out.queue;
493 vec.iov_len = c->out.queue_len;
494 c->out.queue_len = 0;
497 while(c->out.writing)
498 pthread_cond_wait(&c->out.cond, &c->iolock);
499 assert(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request));