mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
XQuartz: Avoid a possible spinlock in applicationWillTerminate
(cherry picked from commit f430cda0fdcc1a8fc5f4795743b40f09ff0bd869)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user