[Xcb] Feature Request: Function "xcb_test_for_event"

Josh Triplett josh at joshtriplett.org
Tue Apr 9 14:00:11 PDT 2013


Bart Massey <bart at cs.pdx.edu> wrote:

>By now, I'm completely lost.
>
>xcb_block_until_event() is called xcb_wait_for_event() as far as I
>know.
>The non-blocking version is xcb_poll_for_event(), but it's almost
>always a
>bad idea to call it.

xcb_wait_for_event returns the event. This new function wouldn't.

>As Josh suggests, if you want to wait on multiple things at once, spawn
>a
>blocking thread per thing, and demux the result using the usual thread
>mechanisms. Pipes are probably overkill here: just use a locked queue.
>If
>you use a semaphore for locking the queue, you can block until
>something is
>in it conveniently.

Pipes help if you have a pile of other fds to wait on.

- Josh Triplett



More information about the Xcb mailing list