Remove Glib thread-safety support
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 2 Oct 2012 18:59:00 +0000 (14:59 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 2 Oct 2012 19:09:38 +0000 (15:09 -0400)
Now that we have pthread detection in configure, we don't need Glib
anymore.  Glib will only be a Unicode data provider.

configure.ac
src/hb-atomic-private.hh
src/hb-mutex-private.hh

index 571f96b..ef1a88e 100644 (file)
@@ -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
index 4ae5b86..5861a71 100644 (file)
@@ -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 <glib.h>
-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)
 
index fc8ef49..5b3a17e 100644 (file)
@@ -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 <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)
 
 #if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD)