OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkCondVar_DEFINED | 8 #ifndef SkCondVar_DEFINED |
9 #define SkCondVar_DEFINED | 9 #define SkCondVar_DEFINED |
10 | 10 |
11 #ifdef SK_USE_POSIX_THREADS | 11 #ifdef SK_USE_POSIX_THREADS |
12 #include <pthread.h> | 12 #include <pthread.h> |
13 #elif defined(SK_BUILD_FOR_WIN32) | 13 #elif defined(SK_BUILD_FOR_WIN32) |
14 #include <Windows.h> | 14 #include <windows.h> |
15 #endif | 15 #endif |
16 | 16 |
17 /** | 17 /** |
18 * Condition variable for blocking access to shared data from other threads and | 18 * Condition variable for blocking access to shared data from other threads and |
19 * controlling which threads are awake. | 19 * controlling which threads are awake. |
20 * | 20 * |
21 * Currently only supported on platforms with posix threads and Windows Vista an
d | 21 * Currently only supported on platforms with posix threads and Windows Vista an
d |
22 * above. | 22 * above. |
23 */ | 23 */ |
24 class SkCondVar { | 24 class SkCondVar { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #ifdef SK_USE_POSIX_THREADS | 59 #ifdef SK_USE_POSIX_THREADS |
60 pthread_mutex_t fMutex; | 60 pthread_mutex_t fMutex; |
61 pthread_cond_t fCond; | 61 pthread_cond_t fCond; |
62 #elif defined(SK_BUILD_FOR_WIN32) | 62 #elif defined(SK_BUILD_FOR_WIN32) |
63 CRITICAL_SECTION fCriticalSection; | 63 CRITICAL_SECTION fCriticalSection; |
64 CONDITION_VARIABLE fCondition; | 64 CONDITION_VARIABLE fCondition; |
65 #endif | 65 #endif |
66 }; | 66 }; |
67 | 67 |
68 #endif | 68 #endif |
OLD | NEW |