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

Side by Side Diff: tools/threadpool/CondVar.h

Issue 371853005: Move threadpool code from include/utils to tools/threadpool. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gyp Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « tools/skpdiff/SkDiffContext.cpp ('k') | tools/threadpool/CondVar.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CondVar_DEFINED
9 #define SkCondVar_DEFINED 9 #define CondVar_DEFINED
10
11 #include "SkTypes.h"
10 12
11 #ifdef SK_USE_POSIX_THREADS 13 #ifdef SK_USE_POSIX_THREADS
12 #include <pthread.h> 14 #include <pthread.h>
13 #elif defined(SK_BUILD_FOR_WIN32) 15 #elif defined(SK_BUILD_FOR_WIN32)
14 #include <windows.h> 16 #include <windows.h>
17 #else
18 #error "CondVar isn't supported on this platform."
15 #endif 19 #endif
16 20
17 /** 21 /**
18 * Condition variable for blocking access to shared data from other threads and 22 * Condition variable for blocking access to shared data from other threads and
19 * controlling which threads are awake. 23 * controlling which threads are awake.
20 * 24 *
21 * Currently only supported on platforms with posix threads and Windows Vista an d 25 * Currently only supported on platforms with posix threads and Windows Vista an d
22 * above. 26 * above.
23 */ 27 */
24 class SkCondVar { 28 class CondVar {
25 public: 29 public:
26 SkCondVar(); 30 CondVar();
27 ~SkCondVar(); 31 ~CondVar();
28 32
29 /** 33 /**
30 * Lock a mutex. Must be done before calling the other functions on this obj ect. 34 * Lock a mutex. Must be done before calling the other functions on this obj ect.
31 */ 35 */
32 void lock(); 36 void lock();
33 37
34 /** 38 /**
35 * Unlock the mutex. 39 * Unlock the mutex.
36 */ 40 */
37 void unlock(); 41 void unlock();
(...skipping 21 matching lines...) Expand all
59 #ifdef SK_USE_POSIX_THREADS 63 #ifdef SK_USE_POSIX_THREADS
60 pthread_mutex_t fMutex; 64 pthread_mutex_t fMutex;
61 pthread_cond_t fCond; 65 pthread_cond_t fCond;
62 #elif defined(SK_BUILD_FOR_WIN32) 66 #elif defined(SK_BUILD_FOR_WIN32)
63 CRITICAL_SECTION fCriticalSection; 67 CRITICAL_SECTION fCriticalSection;
64 CONDITION_VARIABLE fCondition; 68 CONDITION_VARIABLE fCondition;
65 #endif 69 #endif
66 }; 70 };
67 71
68 #endif 72 #endif
OLDNEW
« no previous file with comments | « tools/skpdiff/SkDiffContext.cpp ('k') | tools/threadpool/CondVar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698