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 29 matching lines...) Expand all Loading... |
40 fReentranceCount--; | 40 fReentranceCount--; |
41 if (fReentranceCount == 0) { | 41 if (fReentranceCount == 0) { |
42 fOwner = kIllegalThreadID; | 42 fOwner = kIllegalThreadID; |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 SkMutex fMutex; | 46 SkMutex fMutex; |
47 SkThreadID fOwner; // guarded by fMutex | 47 SkThreadID fOwner; // guarded by fMutex |
48 int fReentranceCount; // guarded by fMutex | 48 int fReentranceCount; // guarded by fMutex |
49 }; | 49 }; |
| 50 #else |
| 51 class GrSingleOwner {}; // Provide a dummy implementation so we can pass pointer
s to constructors |
50 #endif | 52 #endif |
51 | 53 |
52 #endif | 54 #endif |
OLD | NEW |