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

Unified Diff: third_party/WebKit/Source/wtf/ThreadingWin.cpp

Issue 2680843006: Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations. (Closed)
Patch Set: simplify DEFINE_THREAD_SAFE_STATIC_LOCAL() 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/ThreadingWin.cpp
diff --git a/third_party/WebKit/Source/wtf/ThreadingWin.cpp b/third_party/WebKit/Source/wtf/ThreadingWin.cpp
index 420a0b122ffd267296f9644c05f9517f25ad3431..44c81a573568b4c0ebd6952dc44647241e39ae66 100644
--- a/third_party/WebKit/Source/wtf/ThreadingWin.cpp
+++ b/third_party/WebKit/Source/wtf/ThreadingWin.cpp
@@ -125,8 +125,6 @@ typedef struct tagTHREADNAME_INFO {
} THREADNAME_INFO;
#pragma pack(pop)
-static Mutex* atomicallyInitializedStaticMutex;
-
namespace internal {
ThreadIdentifier currentThreadSyscall() {
@@ -135,22 +133,10 @@ ThreadIdentifier currentThreadSyscall() {
} // namespace internal
-void lockAtomicallyInitializedStaticMutex() {
- DCHECK(atomicallyInitializedStaticMutex);
- atomicallyInitializedStaticMutex->lock();
-}
-
-void unlockAtomicallyInitializedStaticMutex() {
- atomicallyInitializedStaticMutex->unlock();
-}
-
void initializeThreading() {
// This should only be called once.
- DCHECK(!atomicallyInitializedStaticMutex);
-
WTFThreadData::initialize();
- atomicallyInitializedStaticMutex = new Mutex;
initializeDates();
// Force initialization of static DoubleToStringConverter converter variable
// inside EcmaScriptConverter function while we are in single thread mode.
@@ -397,11 +383,6 @@ DWORD absoluteTimeToWaitTimeoutInterval(double absoluteTime) {
#if DCHECK_IS_ON()
static bool s_threadCreated = false;
-bool isAtomicallyInitializedStaticMutexLockHeld() {
- return atomicallyInitializedStaticMutex &&
- atomicallyInitializedStaticMutex->locked();
-}
-
bool isBeforeThreadCreated() {
return !s_threadCreated;
}

Powered by Google App Engine
This is Rietveld 408576698