2012-10-12 [iwkse] 3.8.1cvs95
[claws.git] / src / common / utils.c
index 46d3ebe7913a27fe7c7203ba067ca99f49a0172b..1696267ee1735f8394371bb4fd0d69eea5dd62dc 100644 (file)
@@ -5308,3 +5308,22 @@ int claws_unlink(const gchar *filename)
        }
        return g_unlink(filename);
 }
+
+GMutex *cm_mutex_new(void) {
+#if GLIB_CHECK_VERSION(2,32,0)
+       GMutex *m = g_new0(GMutex, 1);
+       g_mutex_init(m);
+       return m;
+#else
+       return g_mutex_new();
+#endif
+}
+
+void cm_mutex_free(GMutex *mutex) {
+#if GLIB_CHECK_VERSION(2,32,0)
+       g_mutex_clear(mutex);
+       g_free(mutex);
+#else
+       g_mutex_free(mutex);
+#endif
+}