Age | Commit message (Collapse) | Author |
|
Since writers must make sure they read as well, threads may have gone to
sleep waiting for the opportunity to read. The writer must wake up one
of those readers or the application can hang.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Josh Triplett <josh@freedesktop.org>
|
|
_xcb_out_send needs _xcb_conn_wait to store back its progress so it can
be reinvoked to pick up where it left off---but then _xcb_out_send
guarantees that it leaves either an empty output vector or a shut-down
connection, so *its* callers never care how much progress was made.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Josh Triplett <josh@freedesktop.org>
|
|
Also replace excessively clever use of bitwise OR with equivalent
addition.
Reported-by: Geoffrey Li <geoffrey@seitopos.com>
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
|
|
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.
|
|
External APIs that used 32-bit sequence numbers continue to do so.
Commit by Josh Triplett and Jamey Sharp.
|
|
These functions are once again a single pthread call, so just make that
call directly.
|
|
- i must be unsigned to be compare in the loop
- sync shadow global sync() function
Signed-off-by: Julien Danjou <julien@danjou.info>
|
|
This parallels the _xcb_lock_io and _xcb_unlock_io factoring.
|
|
xcb_get_maximum_request_length.
|
|
|
|
subdirectory
|
|
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
|
|
|
|
|
|
Issue 0, 1, or 2 syncs as needed and do not handle 16-bit wrap until
absolutely necessary.
|
|
Create a macro, XCB_SEQUENCE_COMPARE, that accepts two sequence numbers and
a comparison operator and correctly handles 32-bit wrap around.
Rewrite all ordered sequence number comparisons to use this macro.
Also, caught one error where a sequence was stored in a signed int variable.
Push out a GetInputFocus request when the sequence number does wrap at 32
bits so that applications cannot see sequence 0 (as that is an error
indicator).
|
|
|
|
|
|
needed. It is not often needed.
|
|
|
|
make it static.
|
|
_xcb_out_flush_to, refactor other functions, make write_block static.
|
|
anything else. Tested only on linux so far though.
|
|
|
|
|
|
being used.
|
|
corresponding code.
|
|
XCB_REQUEST_DISCARD_REPLY.
|
|
an out-parameter. Now 0 is a special sequence number indicating failure.
|
|
vector[0]. Leave vector in well-defined state.
|
|
short length fields.
|
|
When not in RAW mode, a null pointer for iov_base is replaced by up to 3 padding bytes.
|
|
bugfix: do not hold a reference to longlen after it goes out of scope.
|
|
|
|
|
|
There's no more race condition between event and reply handling.
The *RequestBlind and *RequestChecked functions are not yet implemented.
|
|
|
|
|
|
|
|
flushing it.
|
|
a single iovec if needed.)
|
|
XCBSendRequest and write_setup.
This requires dynamically allocating memory in XCBSendRequest, but this
malloc/free pair turns out to cause a 30% speed hit for the 'x11perf -noop'
test -- so for the moment I use alloca where available and fall back to malloc
on other platforms. Later I think I'll change the contract of XCBSendRequest
so the caller is responsible for memory allocation, because the caller ought
to always be able to stack-allocate here.
|
|
|
|
cause XCBWaitForReply to wrongly believe that the request has been flushed. Eventually, we should fix bug #6021.
|
|
only _xcb_out_write calls them.
|
|
not called from outside xcb_in.c.
|
|
|
|
|
|
_xcb_out_flush. Otherwise a reply may be read before we record that we have sent the request, and then XCB gets... confused.
|
|
|