GStaticMutex is deprecated

This commit is contained in:
Behdad Esfahbod 2012-06-16 15:40:03 -04:00
parent 5e113a4b79
commit 49f8e0cd9a
1 changed files with 9 additions and 0 deletions

View File

@ -67,12 +67,21 @@ typedef pthread_mutex_t hb_mutex_impl_t;
#elif !defined(HB_NO_MT) && defined(HAVE_GLIB)
#include <glib.h>
#if !GLIB_CHECK_VERSION(2,32,0)
typedef GStaticMutex hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT G_STATIC_MUTEX_INIT
#define hb_mutex_impl_init(M) g_static_mutex_init (M)
#define hb_mutex_impl_lock(M) g_static_mutex_lock (M)
#define hb_mutex_impl_unlock(M) g_static_mutex_unlock (M)
#define hb_mutex_impl_finish(M) g_static_mutex_free (M)
#else
typedef GMutex hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT {0}
#define hb_mutex_impl_init(M) g_mutex_init (M)
#define hb_mutex_impl_lock(M) g_mutex_lock (M)
#define hb_mutex_impl_unlock(M) g_mutex_unlock (M)
#define hb_mutex_impl_finish(M) g_mutex_clear (M)
#endif
#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)