From 0e292eb2a2abbac152eeea2060e58b7a66449745 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 2 Oct 2012 14:59:00 -0400 Subject: [PATCH] Remove Glib thread-safety support Now that we have pthread detection in configure, we don't need Glib anymore. Glib will only be a Unicode data provider. --- configure.ac | 8 ++++---- src/hb-atomic-private.hh | 13 ------------- src/hb-mutex-private.hh | 20 -------------------- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/configure.ac b/configure.ac index 571f96b..ef1a88e 100644 --- a/configure.ac +++ b/configure.ac @@ -88,20 +88,20 @@ if test "x$GCC" = "xyes"; then esac fi +hb_os_win32=no AC_MSG_CHECKING([for native Win32]) case "$host" in *-*-mingw*) hb_os_win32=yes ;; - *) - hb_os_win32=no - ;; esac AC_MSG_RESULT([$hb_os_win32]) AM_CONDITIONAL(OS_WIN32, test "$hb_os_win32" = "yes") have_pthread=false -AX_PTHREAD([have_pthread=true]) +if test "$hb_os_win32" = no; then + AX_PTHREAD([have_pthread=true]) +fi if $have_pthread; then AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads]) fi diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index 4ae5b86..5861a71 100644 --- a/src/hb-atomic-private.hh +++ b/src/hb-atomic-private.hh @@ -85,19 +85,6 @@ typedef int hb_atomic_int_t; #define hb_atomic_ptr_get(P) (void *) (__sync_synchronize (), *(P)) #define hb_atomic_ptr_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N)) -#elif !defined(HB_NO_MT) && defined(HAVE_GLIB) - -#include -typedef int hb_atomic_int_t; -#if GLIB_CHECK_VERSION(2,29,5) -#define hb_atomic_int_add(AI, V) g_atomic_int_add (&(AI), (V)) -#else -#define hb_atomic_int_add(AI, V) g_atomic_int_exchange_and_add (&(AI), (V)) -#endif - -#define hb_atomic_ptr_get(P) g_atomic_pointer_get (P) -#define hb_atomic_ptr_cmpexch(P,O,N) g_atomic_pointer_compare_and_exchange ((void **) (P), (void *) (O), (void *) (N)) - #elif !defined(HB_NO_MT) diff --git a/src/hb-mutex-private.hh b/src/hb-mutex-private.hh index fc8ef49..5b3a17e 100644 --- a/src/hb-mutex-private.hh +++ b/src/hb-mutex-private.hh @@ -65,26 +65,6 @@ typedef pthread_mutex_t hb_mutex_impl_t; #define hb_mutex_impl_finish(M) pthread_mutex_destroy (M) -#elif !defined(HB_NO_MT) && defined(HAVE_GLIB) - -#include -#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) #if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD) -- 2.7.4