diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-14 16:11:32 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-14 19:15:27 -0700 |
commit | 25191648b8db87735a99243697f73036255c1eb6 (patch) | |
tree | 90aa0541b2595f15beb96fabf9a3a970b726ec18 /hw/xquartz | |
parent | fd5f630bc41de73be3b1d26bf9ce3e9ef1badc3b (diff) |
XQuartz: Don't call mieqEnqueue during server shutdown
Found-by: GuardMalloc
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw/xquartz')
-rw-r--r-- | hw/xquartz/pbproxy/app-main.m | 6 | ||||
-rw-r--r-- | hw/xquartz/pbproxy/main.m | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m index 9055bad06..a8c3a6055 100644 --- a/hw/xquartz/pbproxy/app-main.m +++ b/hw/xquartz/pbproxy/app-main.m @@ -39,9 +39,9 @@ CFStringRef app_prefs_domain_cfstr; /* Stubs */ char *display = NULL; -BOOL serverInitComplete = YES; -pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER; +BOOL serverRunning = YES; +pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; static void signal_handler (int sig) { switch(sig) { diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m index dbdb6d05c..29ce83b35 100644 --- a/hw/xquartz/pbproxy/main.m +++ b/hw/xquartz/pbproxy/main.m @@ -47,17 +47,17 @@ BOOL xpbproxy_is_standalone = NO; x_selection *_selection_object; -extern BOOL serverInitComplete; -extern pthread_mutex_t serverInitCompleteMutex; -extern pthread_cond_t serverInitCompleteCond; +extern BOOL serverRunning; +extern pthread_mutex_t serverRunningMutex; +extern pthread_cond_t serverRunningCond; static inline void wait_for_server_init(void) { /* If the server hasn't finished initializing, wait for it... */ - if(!serverInitComplete) { - pthread_mutex_lock(&serverInitCompleteMutex); - while(!serverInitComplete) - pthread_cond_wait(&serverInitCompleteCond, &serverInitCompleteMutex); - pthread_mutex_unlock(&serverInitCompleteMutex); + if(!serverRunning) { + pthread_mutex_lock(&serverRunningMutex); + while(!serverRunning) + pthread_cond_wait(&serverRunningCond, &serverRunningMutex); + pthread_mutex_unlock(&serverRunningMutex); } } |