summaryrefslogtreecommitdiff
path: root/src/xcbext.h
AgeCommit message (Collapse)Author
2013-11-18Revert "fix deadlock with xcb_take_socket/return_socket v3"Uli Schlachter
This reverts commit 9ae84ad187e2ba440c40f44b8eb21c82c2fdbf12. After this patch was merged, there were complaints about it not being a good idea. Revert this for now until we can agree on this. References: http://lists.freedesktop.org/archives/xcb/2013-June/008340.html Signed-off-by: Uli Schlachter <psychon@znc.in> Conflicts: src/xcbint.h
2013-11-07Add support for receiving fds in repliesKeith Packard
Requests signal which replies will have fds, and the replies report how many fds they expect in byte 1. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-By: Uli Schlachter <psychon@znc.in>
2013-11-07Add xcb_send_fd APIKeith Packard
This uses sendmsg to transmit file descriptors from the application to the X server Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-By: Uli Schlachter <psychon@znc.in>
2013-06-01fix deadlock with xcb_take_socket/return_socket v3Christian König
To prevent different threads from stealing the socket from each other the caller of "xcb_take_socket" must hold a lock that is also acquired in "return_socket". Unfortunately xcb tries to prevent calling return_socket from multiple threads and this can lead to a deadlock situation. A simple example: - X11 has taken the socket - Thread A has locked the display. - Thread B does xcb_no_operation() and thus ends up in libX11's return_socket(), waiting for the display lock. - Thread A calls e.g. xcb_no_operation(), too, ends up in return_socket() and because socket_moving == 1, ends up waiting for thread B => Deadlock This patch allows calling return_socket from different threads at the same time an so resolves the deadlock situation. Partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=20708 v2: fixes additional pthread_cond_wait dependencies, rework comments and patch description v3: separate pthread_cond_wait dependencies and unrelated whitespace change into their own patch, use unsigned for socket_seq Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-23Merge branch 'master' of git://anongit.freedesktop.org/~peterh/libxcbPeter Harris
2010-11-27xcb_take_socket: Document sequence wrap requirementsUli Schlachter
If lots of requests are send without one causing a reply, xcb can get confused about the current sequence number of a reply. Document the requirements of an external socket owner to avoid this problem. The return_socket callback for xcb_take_socket() originally was supposed to return the last sequence number used, but the version committed to libxcb never actually had this signature. This fixes the function's documentation not to mention this non-existent return value. Signed-off-by: Uli Schlachter <psychon@znc.in> Signed-off-by: Julien Danjou <julien@danjou.info>
2010-07-13added xcb_sumof() with restriction to uint8_tChristoph Reimann
2008-10-29Support handing off socket write permission to external code.Josh Triplett
Libraries like Xlib, some XCB language bindings, and potentially others have a common problem: they want to share the X connection with XCB. This requires coordination of request sequence numbers. Previously, XCB had an Xlib-specific lock, and allowed Xlib to block XCB from making requests. Now we've replaced that lock with a handoff mechanism, xcb_take_socket, allowing external code to ask XCB for permission to take over the write side of the socket and send raw data with xcb_writev. The caller of xcb_take_socket must supply a callback which XCB can call when it wants the write side of the socket back to make a request. This callback synchronizes with the external socket owner, flushes any output queues if appropriate, and then returns the sequence number of the last request sent over the socket. Commit by Josh Triplett and Jamey Sharp. Handoff mechanism inspired by Keith Packard.
2006-10-07Move xcb_generate_id from xcbext.h to xcb.hJosh Triplett
Since extensions no longer provide type-specific XID-generation functions, xcb_generate_id now forms part of the xcb client API, rather than the extension API; move it from xcbext.h to xcb.h accordingly.
2006-09-23The Great XCB RenamingJosh Triplett
Rename API to follow a new naming convention: * XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES * xcb_functions_lowercase_with_underscores * xcb_types_lowercase_with_underscores_and_suffix_t * expand all abbreviations like "req", "rep", and "iter" Word boundaries for the names in the protocol descriptions fall: * Wherever the protocol descriptions already have an underscore * Between a lowercase letter and a subsequent uppercase letter * Before the last uppercase letter in a string of uppercase letters followed by a lowercase letter (such as in LSBFirst between LSB and First) * Before and after a string of digits (with exceptions for sized types like xcb_char2b_t and xcb_glx_float32_t to match the stdint.h convention) Also fix up some particular naming issues: * Rename shape_op and shape_kind to drop the "shape_" prefix, since otherwise these types end up as xcb_shape_shape_{op,kind}_t. * Remove leading underscores from enums in the GLX protocol description, previously needed to ensure a word separator, but now redundant. This renaming breaks code written for the previous API naming convention. The scripts in XCB's tools directory will convert code written for the old API to use the new API; they work well enough that we used them to convert the non-program-generated code in XCB, and when run on the old program-generated code, they almost exactly reproduce the new program-generated code (modulo whitespace and bugs in the old code generator). Authors: Vincent Torri, Thomas Hunger, Josh Triplett
2006-04-19Add XCBPollForReply and deprecate XCBGetRequestRead and XCBGetQueuedRequestRead.Jamey Sharp
2006-03-05Implement provably-correct sequence wrap handling. Add flag ↵Jamey Sharp
XCB_REQUEST_DISCARD_REPLY.
2006-03-03API/ABI change: XCBSendRequest returns the sequence number instead of using ↵Jamey Sharp
an out-parameter. Now 0 is a special sequence number indicating failure.
2006-02-27Add XCB_REQUEST_RAW flag for XCBSendRequest.Jamey Sharp
2006-02-26API/ABI break: Add flags to XCBSendRequest, first for error-checked requests.Jamey Sharp
There's no more race condition between event and reply handling. The *RequestBlind and *RequestChecked functions are not yet implemented.
2006-02-18Remove xcl and CVSROOT.Josh Triplett