[Xcb] (no subject)

Uli Schlachter psychon at znc.in
Mon Mar 31 01:45:34 PDT 2014


Hi,

On 30.03.2014 22:03, Adrian Ratnapala wrote:
[...]
> The specific problems are:
> 
> * The event thread (E) starts but a separate thread (W) will create
> and map a window.
> * W successfully sends CreateWindow and gets the reply with
> `xcb_check_request()`.
> * W sends the MapWindow requests.
> * E calls `xcb_wait_for_event()`
> * W calls `xcb_check_request()` for the MapWindow.
> * DEADLOCK.

I tried to capture this behavior in the attached example. I don't have any
problem with it. Does it do what you would want it to do?

[...]
> The other problem is intermittent crashes when thread W tries to close
> the display.
> At that point thread E is still blocking on `xcb_wait_for_event()`.
> The crash happens
> inside XCloseDisplay  (I am using XInitThreads(); XOpenDisplay();
> XGetXCBConnection()).
> Thread E calls `xcb_connection_has_error` immediately after the event
> wait -- perhaps this
> is not safe to do while after XCloseDisplay() is called.

Uhm, that is Xlib. Xlib is not XCB and doesn't magically become more thread-safe
when it uses XCB.

Also, you are right that calling anything on already-freed memory is a bad idea
and isn't ok with xcb either.

Cheers,
Uli
-- 
"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.c
Type: text/x-csrc
Size: 1714 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20140331/e22c6170/attachment.c>


More information about the Xcb mailing list