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

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

Issue 1948193002: SK_DECLARE_STATIC_MUTEX -> static SkMutex (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/views/SkEventSink.cpp » ('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 2013 Google Inc. 2 * Copyright 2013 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 #include "SkTypes.h" 7 #include "SkTypes.h"
8 #if defined(SK_BUILD_FOR_WIN32) 8 #if defined(SK_BUILD_FOR_WIN32)
9 9
10 #include "SkTLS.h" 10 #include "SkTLS.h"
11 #include "SkMutex.h" 11 #include "SkMutex.h"
12 12
13 static bool gOnce = false; 13 static bool gOnce = false;
14 static DWORD gTlsIndex; 14 static DWORD gTlsIndex;
15 SK_DECLARE_STATIC_MUTEX(gMutex); 15 static SkMutex gMutex;
16 16
17 void* SkTLS::PlatformGetSpecific(bool forceCreateTheSlot) { 17 void* SkTLS::PlatformGetSpecific(bool forceCreateTheSlot) {
18 if (!forceCreateTheSlot && !gOnce) { 18 if (!forceCreateTheSlot && !gOnce) {
19 return nullptr; 19 return nullptr;
20 } 20 }
21 21
22 if (!gOnce) { 22 if (!gOnce) {
23 SkAutoMutexAcquire tmp(gMutex); 23 SkAutoMutexAcquire tmp(gMutex);
24 if (!gOnce) { 24 if (!gOnce) {
25 gTlsIndex = TlsAlloc(); 25 gTlsIndex = TlsAlloc();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #else 70 #else
71 71
72 #pragma data_seg(".CRT$XLB") 72 #pragma data_seg(".CRT$XLB")
73 PIMAGE_TLS_CALLBACK skia_tls_callback = onTLSCallback; 73 PIMAGE_TLS_CALLBACK skia_tls_callback = onTLSCallback;
74 #pragma data_seg() 74 #pragma data_seg()
75 75
76 #endif 76 #endif
77 } 77 }
78 78
79 #endif//defined(SK_BUILD_FOR_WIN32) 79 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/views/SkEventSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698