diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-09-03 02:36:39 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-09-03 02:36:39 -0700 |
commit | ebfe49dfca6e04d66232bad760f522629397cc35 (patch) | |
tree | 6e7d2644139b93befdf72eec70a178ca71530403 /hw/xquartz | |
parent | da647f1add4c1ae7854c0fbfbf972666ce5d12c8 (diff) |
XQuartz: Cleaned up our sleeping before adding the launchd socket.
Diffstat (limited to 'hw/xquartz')
-rw-r--r-- | hw/xquartz/darwinEvents.c | 12 | ||||
-rw-r--r-- | hw/xquartz/mach-startup/bundle-main.c | 15 |
2 files changed, 2 insertions, 25 deletions
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 15953e373..9cb553302 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -116,18 +116,6 @@ static inline void darwinEvents_lock(void) { } if(darwinEvents == NULL) { pthread_cond_wait(&mieq_ready_cond, &mieq_lock); - - /* We want to give xinit time to finish running xinitrc before we accept - * the launchd socket connection. - * - * Yes, we lock then immediately unlock because the lock does a cond_wait - * when darwinEvents == NULL - * - * TODO: Cleanup this race more elegantly. - * - * For some reason, xinitrc doesn't run until after this anyways... =/ - * sleep(2); - */ } } diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c index 6f1704e45..1d4725131 100644 --- a/hw/xquartz/mach-startup/bundle-main.c +++ b/hw/xquartz/mach-startup/bundle-main.c @@ -190,20 +190,9 @@ static void accept_fd_handoff(int connected_fd) { * into it. */ -#if 0 - struct timeval start, now; - gettimeofday(&start, NULL); - gettimeofday(&now, NULL); - while((now.tv_sec - start.tv_sec) * 1000000 + (now.tv_usec - start.tv_usec) < 2000000) { - unsigned usec = 3000001 - ((now.tv_sec - start.tv_sec) * 1000000 + (now.tv_usec - start.tv_usec)); - fprintf(stderr, "X11.app: Received new DISPLAY fd: %d ... sleeping to allow xinitrc to catchup (%u).\n", launchd_fd, usec); - usleep(usec); - gettimeofday(&now, NULL); - } -#else + unsigned remain = 3000000; fprintf(stderr, "X11.app: Received new DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd); - sleep(3); -#endif + while((remain = usleep(remain)) > 0); #endif fprintf(stderr, "X11.app Handing off fd to server thread via DarwinListenOnOpenFD(%d)\n", launchd_fd); |