diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-07-28 22:52:33 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-07-28 22:54:11 -0700 |
commit | a85523dc50f392a33a1c00302a0946828bc9249d (patch) | |
tree | 7f6f9c62c370394f305ce2276b31d71800fae7e5 | |
parent | 1e49c8d340ee8d8b6f90abcc2e2e9c390cbcd622 (diff) |
XQuartz: Avoid a possible spinlock in applicationWillTerminate
(cherry picked from commit f430cda0fdcc1a8fc5f4795743b40f09ff0bd869)
-rw-r--r-- | hw/xquartz/X11Controller.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 9477e94db..990053705 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -781,13 +781,16 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (void) applicationWillTerminate:(NSNotification *)aNotification { + unsigned remain; [X11App prefs_synchronize]; /* shutdown the X server, it will exit () for us. */ DarwinSendDDXEvent(kXquartzQuit, 0); /* In case it doesn't, exit anyway after a while. */ - while (sleep (10) != 0) ; + remain = 10000000; + while((remain = usleep(remain)) > 0); + exit (1); } |