Mesa (7.11): darwin: Unlock our mutex before destroying it

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed May 16 18:59:50 PDT 2012


Module: Mesa
Branch: 7.11
Commit: 60fa18b90fef1c67f52d610abed0d2ac39238deb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=60fa18b90fef1c67f52d610abed0d2ac39238deb

Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu May 10 18:56:50 2012 -0700

darwin: Unlock our mutex before destroying it

http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
(cherry picked from commit a73a800b3200d21c32fac9f28e2f86919bc0a2ba)

---

 src/glx/apple/apple_glx_drawable.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c
index db28302..aaa2774 100644
--- a/src/glx/apple/apple_glx_drawable.c
+++ b/src/glx/apple/apple_glx_drawable.c
@@ -173,6 +173,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));



More information about the mesa-commit mailing list