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

Unified Diff: third_party/WebKit/Source/wtf/ThreadingPthreads.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/ThreadingPthreads.cpp
diff --git a/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp b/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
index fdbc0fbfa38769cf21a0242773546fa6a8e8df2e..85a3976090948bb06a944969aa7b771ef9d023f1 100644
--- a/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
+++ b/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
@@ -75,30 +75,16 @@ ThreadIdentifier currentThreadSyscall() {
} // namespace internal
-static Mutex* atomicallyInitializedStaticMutex;
-
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.
double_conversion::DoubleToStringConverter::EcmaScriptConverter();
}
-void lockAtomicallyInitializedStaticMutex() {
- DCHECK(atomicallyInitializedStaticMutex);
- atomicallyInitializedStaticMutex->lock();
-}
-
-void unlockAtomicallyInitializedStaticMutex() {
- atomicallyInitializedStaticMutex->unlock();
-}
-
ThreadIdentifier currentThread() {
return wtfThreadData().threadId();
}
@@ -233,11 +219,6 @@ void ThreadCondition::broadcast() {
#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