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

Side by Side Diff: include/core/SkMutex.h

Issue 1207893002: Clean up a few includes, introduce iwyu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkTypes to export stddef. Created 5 years, 4 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 | « include/core/SkAtomics.h ('k') | include/core/SkPostConfig.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 SkMutex_DEFINED 8 #ifndef SkMutex_DEFINED
9 #define SkMutex_DEFINED 9 #define SkMutex_DEFINED
10 10
11 // This file is not part of the public Skia API. 11 // This file is not part of the public Skia API.
12 #include "SkTypes.h" 12 #include "SkTypes.h"
13 13
14 // IWYU pragma: begin_exports
14 #if defined(SK_BUILD_FOR_WIN) 15 #if defined(SK_BUILD_FOR_WIN)
15 #include "../ports/SkMutex_win.h" 16 #include "../ports/SkMutex_win.h"
16 #else 17 #else
17 #include "../ports/SkMutex_pthread.h" 18 #include "../ports/SkMutex_pthread.h"
18 #endif 19 #endif
20 // IWYU pragma: end_exports
19 21
20 template <typename Lock> 22 template <typename Lock>
21 class SkAutoTAcquire : SkNoncopyable { 23 class SkAutoTAcquire : SkNoncopyable {
22 public: 24 public:
23 explicit SkAutoTAcquire(Lock& mutex) : fMutex(&mutex) { 25 explicit SkAutoTAcquire(Lock& mutex) : fMutex(&mutex) {
24 SkASSERT(fMutex != NULL); 26 SkASSERT(fMutex != NULL);
25 mutex.acquire(); 27 mutex.acquire();
26 } 28 }
27 29
28 explicit SkAutoTAcquire(Lock* mutex) : fMutex(mutex) { 30 explicit SkAutoTAcquire(Lock* mutex) : fMutex(mutex) {
(...skipping 26 matching lines...) Expand all
55 private: 57 private:
56 Lock* fMutex; 58 Lock* fMutex;
57 }; 59 };
58 60
59 typedef SkAutoTAcquire<SkBaseMutex> SkAutoMutexAcquire; 61 typedef SkAutoTAcquire<SkBaseMutex> SkAutoMutexAcquire;
60 62
61 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire) 63 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire)
62 64
63 65
64 #endif//SkMutex_DEFINED 66 #endif//SkMutex_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkAtomics.h ('k') | include/core/SkPostConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698