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

Side by Side Diff: src/ports/SkThread_win.cpp

Issue 18770007: Add a 'unique' method to SkRefCnt, document the usage, and add support. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« src/core/SkPathRef.h ('K') | « src/ports/SkThread_pthread.cpp ('k') | no next file » | 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 /* 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
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
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 }
OLDNEW
« src/core/SkPathRef.h ('K') | « src/ports/SkThread_pthread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698