sync patch with what has been committed upstrea now; no pkg change.

This commit is contained in:
jasper 2012-10-05 16:44:27 +00:00
parent c0642b372f
commit 7e4ff1d276

View File

@ -1,18 +1,25 @@
$OpenBSD: patch-clutter_clutter-main_c,v 1.1 2012/09/27 11:48:23 jasper Exp $
$OpenBSD: patch-clutter_clutter-main_c,v 1.2 2012/10/05 16:44:27 jasper Exp $
From 48b3e9ca8b81080bb75869c85f213b8c415fba6f Mon Sep 17 00:00:00 2001
From 0da0e5122e7526ada688beef22684bb0ed54a367 Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Wed, 26 Sep 2012 09:45:46 +0100
Subject: [PATCH] main: Do not release the lock if it hasn't been acquired
Date: Wed, 26 Sep 2012 08:45:46 +0000
Subject: main: Do not release the lock if it hasn't been acquired
https://bugzilla.gnome.org/show_bug.cgi?id=679439
--- clutter/clutter-main.c.orig Thu Sep 27 12:57:55 2012
+++ clutter/clutter-main.c Thu Sep 27 12:58:21 2012
@@ -226,6 +226,7 @@ clutter_threads_impl_lock (void)
--- clutter/clutter-main.c.orig Mon Sep 24 17:59:01 2012
+++ clutter/clutter-main.c Fri Oct 5 18:44:09 2012
@@ -226,6 +226,16 @@ clutter_threads_impl_lock (void)
static void
clutter_threads_impl_unlock (void)
{
+ /* we need to trylock here, in case the lock hasn't been acquired; on
+ * various systems trying to release a mutex that hasn't been acquired
+ * will cause a run-time error. trylock() will either fail, in which
+ * case we can release the lock we own; or it will succeeds, in which
+ * case we need to release the lock we just acquired. so we ignore the
+ * returned value.
+ *
+ * see: https://bugs.gnome.org/679439
+ */
+ g_mutex_trylock (&clutter_threads_mutex);
g_mutex_unlock (&clutter_threads_mutex);
}