OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2007 Chris Wilson | 2 * Copyright © 2007 Chris Wilson |
3 * Copyright © 2009,2010 Red Hat, Inc. | 3 * Copyright © 2009,2010 Red Hat, Inc. |
4 * Copyright © 2011,2012 Google, Inc. | 4 * Copyright © 2011,2012 Google, Inc. |
5 * | 5 * |
6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
7 * | 7 * |
8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 /* mutex */ | 38 /* mutex */ |
39 | 39 |
40 /* We need external help for these */ | 40 /* We need external help for these */ |
41 | 41 |
42 #if 0 | 42 #if 0 |
43 | 43 |
44 | 44 |
45 #elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__)) | 45 #elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__)) |
46 | 46 |
47 #define WIN32_LEAN_AND_MEAN | |
48 #include <windows.h> | 47 #include <windows.h> |
49 typedef CRITICAL_SECTION hb_mutex_impl_t; | 48 typedef CRITICAL_SECTION hb_mutex_impl_t; |
50 #define HB_MUTEX_IMPL_INIT» { NULL, 0, 0, NULL, NULL, 0 } | 49 #define HB_MUTEX_IMPL_INIT» {0} |
51 #define hb_mutex_impl_init(M) InitializeCriticalSection (M) | 50 #define hb_mutex_impl_init(M) InitializeCriticalSection (M) |
52 #define hb_mutex_impl_lock(M) EnterCriticalSection (M) | 51 #define hb_mutex_impl_lock(M) EnterCriticalSection (M) |
53 #define hb_mutex_impl_unlock(M) LeaveCriticalSection (M) | 52 #define hb_mutex_impl_unlock(M) LeaveCriticalSection (M) |
54 #define hb_mutex_impl_finish(M) DeleteCriticalSection (M) | 53 #define hb_mutex_impl_finish(M) DeleteCriticalSection (M) |
55 | 54 |
56 | 55 |
57 #elif !defined(HB_NO_MT) && (defined(HAVE_PTHREAD) || defined(__APPLE__)) | 56 #elif !defined(HB_NO_MT) && (defined(HAVE_PTHREAD) || defined(__APPLE__)) |
58 | 57 |
59 #include <pthread.h> | 58 #include <pthread.h> |
60 typedef pthread_mutex_t hb_mutex_impl_t; | 59 typedef pthread_mutex_t hb_mutex_impl_t; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 hb_mutex_impl_t m; | 120 hb_mutex_impl_t m; |
122 | 121 |
123 inline void init (void) { hb_mutex_impl_init (&m); } | 122 inline void init (void) { hb_mutex_impl_init (&m); } |
124 inline void lock (void) { hb_mutex_impl_lock (&m); } | 123 inline void lock (void) { hb_mutex_impl_lock (&m); } |
125 inline void unlock (void) { hb_mutex_impl_unlock (&m); } | 124 inline void unlock (void) { hb_mutex_impl_unlock (&m); } |
126 inline void finish (void) { hb_mutex_impl_finish (&m); } | 125 inline void finish (void) { hb_mutex_impl_finish (&m); } |
127 }; | 126 }; |
128 | 127 |
129 | 128 |
130 #endif /* HB_MUTEX_PRIVATE_HH */ | 129 #endif /* HB_MUTEX_PRIVATE_HH */ |
OLD | NEW |