XQuartz: Cleaned up our sleeping before adding the launchd socket.
(cherry picked from commitebfe49dfca
) (cherry picked from commit2cf74a76d5
)
This commit is contained in:
parent
7c5ca85a9e
commit
b3836e5bdd
|
@ -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);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user