Index: files/patch-glib_gthread-posix.c =================================================================== --- files/patch-glib_gthread-posix.c (revision 323030) +++ files/patch-glib_gthread-posix.c (working copy) @@ -1,5 +1,5 @@ ---- glib/gthread-posix.c.orig 2012-11-10 03:24:06.000000000 +0000 -+++ glib/gthread-posix.c 2012-11-12 18:06:36.000000000 +0000 +--- glib/gthread-posix.c.orig 2012-11-26 17:52:48.000000000 +0100 ++++ glib/gthread-posix.c 2013-07-15 21:44:24.000000000 +0200 @@ -89,7 +89,7 @@ if G_UNLIKELY (mutex == NULL) g_thread_abort (errno, "malloc"); @@ -18,3 +18,21 @@ pthread_mutexattr_destroy (&attr); #endif +@@ -226,8 +226,15 @@ + { + gint status; + +- if G_UNLIKELY ((status = pthread_mutex_unlock (g_mutex_get_impl (mutex))) != 0) +- g_thread_abort (status, "pthread_mutex_unlock"); ++ // EINVAL = mutex invalid ++ // EPERM = current thread does not hold a lock on mutex ++ status = pthread_mutex_unlock (g_mutex_get_impl (mutex)); ++ ++ if G_UNLIKELY (status != 0) ++ { ++ if (status != EPERM) ++ g_thread_abort (status, "pthread_mutex_unlock"); ++ } + } + + /**