OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 if (_InterlockedCompareExchange(reinterpret_cast<LONG*>(addr), | 43 if (_InterlockedCompareExchange(reinterpret_cast<LONG*>(addr), |
44 value + 1, | 44 value + 1, |
45 value) == value) { | 45 value) == value) { |
46 return value; | 46 return value; |
47 } | 47 } |
48 } | 48 } |
49 } | 49 } |
50 void sk_membar_aquire__after_atomic_conditional_inc() { } | 50 void sk_membar_aquire__after_atomic_conditional_inc() { } |
51 | 51 |
| 52 int32_t sk_atomic_unprotected_read(const volatile int32_t & x) { |
| 53 return x; |
| 54 } |
| 55 |
52 SkMutex::SkMutex() { | 56 SkMutex::SkMutex() { |
53 SK_COMPILE_ASSERT(sizeof(fStorage) > sizeof(CRITICAL_SECTION), | 57 SK_COMPILE_ASSERT(sizeof(fStorage) > sizeof(CRITICAL_SECTION), |
54 NotEnoughSizeForCriticalSection); | 58 NotEnoughSizeForCriticalSection); |
55 InitializeCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage)); | 59 InitializeCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage)); |
56 } | 60 } |
57 | 61 |
58 SkMutex::~SkMutex() { | 62 SkMutex::~SkMutex() { |
59 DeleteCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage)); | 63 DeleteCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(&fStorage)); |
60 } | 64 } |
61 | 65 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 #pragma const_seg() | 131 #pragma const_seg() |
128 | 132 |
129 #else | 133 #else |
130 | 134 |
131 #pragma data_seg(".CRT$XLB") | 135 #pragma data_seg(".CRT$XLB") |
132 PIMAGE_TLS_CALLBACK skia_tls_callback = onTLSCallback; | 136 PIMAGE_TLS_CALLBACK skia_tls_callback = onTLSCallback; |
133 #pragma data_seg() | 137 #pragma data_seg() |
134 | 138 |
135 #endif | 139 #endif |
136 } | 140 } |
OLD | NEW |