summaryrefslogtreecommitdiff
path: root/gdk/gdk.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-11-01 21:11:04 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-11-01 21:11:04 -0400
commitc3d2df4eab740aeecaa0a9956e4b0bf27da32d5a (patch)
tree2457390be254b11f46c4cbca97b733e0d430377a /gdk/gdk.c
parent4ac4a1bee352eefec217012b8597cc1845044fea (diff)
downloadgtk+-c3d2df4eab740aeecaa0a9956e4b0bf27da32d5a.tar.gz
GDK: Adapt to GLib thread api changes
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r--gdk/gdk.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index b632f4c5f8..c11b5dc55c 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -101,7 +101,7 @@ static int gdk_initialized = 0; /* 1 if the library is initi
static gchar *gdk_progclass = NULL;
-static GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
+static GMutex gdk_threads_mutex;
static GCallback gdk_threads_lock = NULL;
static GCallback gdk_threads_unlock = NULL;
@@ -668,15 +668,13 @@ gdk_threads_leave (void)
static void
gdk_threads_impl_lock (void)
{
- if (gdk_threads_mutex)
- g_mutex_lock (gdk_threads_mutex);
+ g_mutex_lock (&gdk_threads_mutex);
}
static void
gdk_threads_impl_unlock (void)
{
- if (gdk_threads_mutex)
- g_mutex_unlock (gdk_threads_mutex);
+ g_mutex_unlock (&gdk_threads_mutex);
}
/**
@@ -692,10 +690,6 @@ gdk_threads_impl_unlock (void)
void
gdk_threads_init (void)
{
- if (!g_thread_supported ())
- g_error ("g_thread_init() must be called before gdk_threads_init()");
-
- gdk_threads_mutex = g_mutex_new ();
if (!gdk_threads_lock)
gdk_threads_lock = gdk_threads_impl_lock;
if (!gdk_threads_unlock)