Index: Source/wtf/ThreadingWin.cpp |
diff --git a/Source/wtf/ThreadingWin.cpp b/Source/wtf/ThreadingWin.cpp |
index cc342571014f09a02c1ea9d3a519d4a42200e44c..06cd6b0f2b7e902cfb1026b1b6086b895a6a69a6 100644 |
--- a/Source/wtf/ThreadingWin.cpp |
+++ b/Source/wtf/ThreadingWin.cpp |
@@ -391,6 +391,33 @@ DWORD absoluteTimeToWaitTimeoutInterval(double absoluteTime) |
return static_cast<DWORD>((absoluteTime - currentTime) * 1000.0); |
} |
+#if ENABLE(ASSERT) |
+static bool s_threadCreated = false; |
+ |
+struct ThreadCreationRecorder { |
+ ThreadCreationRecorder() |
+ { |
+ ASSERT(!s_threadCreated); |
+ s_threadCreated = true; |
+ } |
+}; |
+ |
+bool isAtomicallyInitializedStaticMutexLockHeld() |
+{ |
+ return atomicallyInitializedStaticMutex && atomicallyInitializedStaticMutex->locked(); |
+} |
+ |
+bool isBeforeThreadCreated() |
+{ |
+ return !s_threadCreated; |
+} |
+ |
+void willCreateThread() |
+{ |
+ static ThreadCreationRecorder recorder; |
+} |
+#endif |
+ |
} // namespace WTF |
#endif // OS(WIN) |