OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 GrSingleOwner_DEFINED | 8 #ifndef GrSingleOwner_DEFINED |
9 #define GrSingleOwner_DEFINED | 9 #define GrSingleOwner_DEFINED |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 fReentranceCount--; | 41 fReentranceCount--; |
42 if (fReentranceCount == 0) { | 42 if (fReentranceCount == 0) { |
43 fOwner = kIllegalThreadID; | 43 fOwner = kIllegalThreadID; |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 SkMutex fMutex; | 47 SkMutex fMutex; |
48 SkThreadID fOwner; // guarded by fMutex | 48 SkThreadID fOwner; // guarded by fMutex |
49 int fReentranceCount; // guarded by fMutex | 49 int fReentranceCount; // guarded by fMutex |
50 }; | 50 }; |
| 51 #else |
| 52 class GrSingleOwner {}; // Provide a dummy implementation so we can pass pointer
s to constructors |
51 #endif | 53 #endif |
52 | 54 |
53 #endif | 55 #endif |
OLD | NEW |