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

Side by Side Diff: third_party/WebKit/Source/wtf/ThreadingWin.cpp

Issue 2646003003: Avoid checking for WTFThreadData::staticData in wtfThreadData() (Closed)
Patch Set: fix bad rebase Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved. 4 * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 void unlockAtomicallyInitializedStaticMutex() { 143 void unlockAtomicallyInitializedStaticMutex() {
144 atomicallyInitializedStaticMutex->unlock(); 144 atomicallyInitializedStaticMutex->unlock();
145 } 145 }
146 146
147 void initializeThreading() { 147 void initializeThreading() {
148 // This should only be called once. 148 // This should only be called once.
149 DCHECK(!atomicallyInitializedStaticMutex); 149 DCHECK(!atomicallyInitializedStaticMutex);
150 150
151 WTFThreadData::initialize();
152
151 atomicallyInitializedStaticMutex = new Mutex; 153 atomicallyInitializedStaticMutex = new Mutex;
152 wtfThreadData();
153 initializeDates(); 154 initializeDates();
154 // Force initialization of static DoubleToStringConverter converter variable 155 // Force initialization of static DoubleToStringConverter converter variable
155 // inside EcmaScriptConverter function while we are in single thread mode. 156 // inside EcmaScriptConverter function while we are in single thread mode.
156 double_conversion::DoubleToStringConverter::EcmaScriptConverter(); 157 double_conversion::DoubleToStringConverter::EcmaScriptConverter();
157 } 158 }
158 159
159 ThreadIdentifier currentThread() { 160 ThreadIdentifier currentThread() {
160 return wtfThreadData().threadId(); 161 return wtfThreadData().threadId();
161 } 162 }
162 163
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 407 }
407 408
408 void willCreateThread() { 409 void willCreateThread() {
409 s_threadCreated = true; 410 s_threadCreated = true;
410 } 411 }
411 #endif 412 #endif
412 413
413 } // namespace WTF 414 } // namespace WTF
414 415
415 #endif // OS(WIN) 416 #endif // OS(WIN)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/ThreadingPthreads.cpp ('k') | third_party/WebKit/Source/wtf/WTFThreadData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698