darwin: Unlock our mutex before destroying it
authorJeremy Huddleston <jeremyhu@apple.com>
Fri, 11 May 2012 01:56:50 +0000 (18:56 -0700)
committerJeremy Huddleston <jeremyhu@apple.com>
Thu, 17 May 2012 01:58:29 +0000 (18:58 -0700)
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
src/glx/apple/apple_glx_drawable.c

index 3f84d56..b261a55 100644 (file)
@@ -174,6 +174,9 @@ destroy_drawable(struct apple_glx_drawable *d)
 
    apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d);
 
+   /* Stupid recursive locks */
+   while (pthread_mutex_unlock(&d->mutex) == 0);
+
    err = pthread_mutex_destroy(&d->mutex);
    if (err) {
       fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err));