Skip to content

Commit

Permalink
XQuartz: Ensure we wait for the server thread to terminate
Browse files Browse the repository at this point in the history
AKA: XQuartz 2.7.5 doesn't delete its /tmp/.X$d-lock

http://xquartz.macosforge.org/trac/ticket/823

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
  • Loading branch information
jeremyhu committed Apr 6, 2014
1 parent 901fbfb commit ec6007e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hw/xquartz/X11Controller.m
Expand Up @@ -942,9 +942,8 @@ - (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN
/* shutdown the X server, it will exit () for us. */
DarwinSendDDXEvent(kXquartzQuit, 0);

/* In case it doesn't, exit anyway after a while. */
remain = 10000000;
while ((remain = usleep(remain)) > 0) ;
/* In case it doesn't, exit anyway after 5s. */
[NSThread sleepForTimeInterval:5.0];

exit(1);
}
Expand Down

0 comments on commit ec6007e

Please sign in to comment.