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

Author: Jeremy Huddleston <jerem...@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 <jerem...@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));

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to