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 24 matching lines...) Expand all Loading... |
35 #include "hb-private.hh" | 35 #include "hb-private.hh" |
36 | 36 |
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(_MSC_VER) || defined(__MINGW32__) | 45 #elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__)) |
46 | 46 |
47 #define WIN32_LEAN_AND_MEAN | 47 #define WIN32_LEAN_AND_MEAN |
48 #include <windows.h> | 48 #include <windows.h> |
49 typedef CRITICAL_SECTION hb_mutex_impl_t; | 49 typedef CRITICAL_SECTION hb_mutex_impl_t; |
50 #define HB_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 } | 50 #define HB_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 } |
51 #define hb_mutex_impl_init(M) InitializeCriticalSection (M) | 51 #define hb_mutex_impl_init(M) InitializeCriticalSection (M) |
52 #define hb_mutex_impl_lock(M) EnterCriticalSection (M) | 52 #define hb_mutex_impl_lock(M) EnterCriticalSection (M) |
53 #define hb_mutex_impl_unlock(M) LeaveCriticalSection (M) | 53 #define hb_mutex_impl_unlock(M) LeaveCriticalSection (M) |
54 #define hb_mutex_impl_finish(M) DeleteCriticalSection (M) | 54 #define hb_mutex_impl_finish(M) DeleteCriticalSection (M) |
55 | 55 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 hb_mutex_impl_t m; | 121 hb_mutex_impl_t m; |
122 | 122 |
123 inline void init (void) { hb_mutex_impl_init (&m); } | 123 inline void init (void) { hb_mutex_impl_init (&m); } |
124 inline void lock (void) { hb_mutex_impl_lock (&m); } | 124 inline void lock (void) { hb_mutex_impl_lock (&m); } |
125 inline void unlock (void) { hb_mutex_impl_unlock (&m); } | 125 inline void unlock (void) { hb_mutex_impl_unlock (&m); } |
126 inline void finish (void) { hb_mutex_impl_finish (&m); } | 126 inline void finish (void) { hb_mutex_impl_finish (&m); } |
127 }; | 127 }; |
128 | 128 |
129 | 129 |
130 #endif /* HB_MUTEX_PRIVATE_HH */ | 130 #endif /* HB_MUTEX_PRIVATE_HH */ |
OLD | NEW |