Fix possible deadlock during startup

For setting up the wallpaper, awesome needs a second connection to the X11
server (isn't SetCloseDownMode just great?).

However, it was possible to have a dead-lock with our main connection due to
this. Awesome does a GrabServer during startup so that nothing else can use the
X11 server while we set ourselves up. The server is ungrabbed right before the
lua config is read. However, nothing makes sure that this ungrab request really
is sent to the server instead of just waiting in xcb's output buffer.

The dead-lock would now happen if we try to establish a second connection to the
X11 server before the ungrab request was flushed on the main connection. The
server will wait for the ungrab on the first connection, awesome is waiting for
the second connection to be successfully established.

Fix this by making sure the UngrabServer request is flushed before parsing the
config file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2013-10-04 10:01:03 +02:00
parent 8792d6a4ba
commit 9b78733922
1 changed files with 1 additions and 0 deletions

View File

@ -516,6 +516,7 @@ main(int argc, char **argv)
/* we will receive events, stop grabbing server */
xcb_ungrab_server(globalconf.connection);
xcb_flush(globalconf.connection);
/* Parse and run configuration file */
if (!luaA_parserc(&xdg, confpath, true))