Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/harfbuzz-ng/src/hb-mutex-private.hh

Issue 10510004: Roll harfbuzz-ng 3b8fd9c48f4bde368bf2d465c148b9743a9216ee (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-icu.h ('k') | third_party/harfbuzz-ng/src/hb-object-private.hh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-mutex-private.hh
diff --git a/third_party/harfbuzz-ng/src/hb-mutex-private.hh b/third_party/harfbuzz-ng/src/hb-mutex-private.hh
index 9855a5654f52bf67d78851f67c99d4d3cf36b093..44b48df223c934e1799e8cd429d959d17f2c408a 100644
--- a/third_party/harfbuzz-ng/src/hb-mutex-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-mutex-private.hh
@@ -35,27 +35,16 @@
#include "hb-private.hh"
-
/* mutex */
/* We need external help for these */
-#ifdef HAVE_GLIB
+#if 0
-#include <glib.h>
-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_free(M) g_static_mutex_free (M)
-
-
-#elif defined(_MSC_VER) || defined(__MINGW32__)
+#elif !defined(HB_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h>
-
typedef CRITICAL_SECTION hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 }
#define hb_mutex_impl_init(M) InitializeCriticalSection (M)
@@ -64,10 +53,31 @@ typedef CRITICAL_SECTION hb_mutex_impl_t;
#define hb_mutex_impl_free(M) DeleteCriticalSection (M)
-#else
+#elif !defined(HB_NO_MT) && defined(__APPLE__)
+
+#include <pthread.h>
+typedef pthread_mutex_t hb_mutex_impl_t;
+#define HB_MUTEX_IMPL_INIT PTHREAD_MUTEX_INITIALIZER
+#define hb_mutex_impl_init(M) pthread_mutex_init (M, NULL)
+#define hb_mutex_impl_lock(M) pthread_mutex_lock (M)
+#define hb_mutex_impl_unlock(M) pthread_mutex_unlock (M)
+#define hb_mutex_impl_free(M) pthread_mutex_destroy (M)
-#warning "Could not find any system to define platform macros, library will NOT be thread-safe"
+#elif !defined(HB_NO_MT) && defined(HAVE_GLIB)
+
+#include <glib.h>
+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_free(M) g_static_mutex_free (M)
+
+
+#else
+
+#define HB_MUTEX_IMPL_NIL 1
typedef volatile int hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT 0
#define hb_mutex_impl_init(M) ((void) (*(M) = 0))
@@ -75,7 +85,6 @@ typedef volatile int hb_mutex_impl_t;
#define hb_mutex_impl_unlock(M) ((void) (*(M) = 0))
#define hb_mutex_impl_free(M) ((void) (*(M) = 2))
-
#endif
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-icu.h ('k') | third_party/harfbuzz-ng/src/hb-object-private.hh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698