Title: [260911] trunk/Source/WTF
Revision
260911
Author
[email protected]
Date
2020-04-29 13:06:18 -0700 (Wed, 29 Apr 2020)

Log Message

[Win] Deadlock in WTF::Thread::didExit() while WebKitNetworkProcess.exe is exiting
https://bugs.webkit.org/show_bug.cgi?id=210955

Reviewed by Don Olmstead.

The thread_local object of the main thread is destructed after
Windows terminates other threads. If the terminated thread was
holding a mutex, trying to lock the mutex causes deadlock.

* wtf/win/ThreadingWin.cpp:
(WTF::Thread::ThreadHolder::~ThreadHolder): Do nothing if the
thread is the main thread.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (260910 => 260911)


--- trunk/Source/WTF/ChangeLog	2020-04-29 19:38:11 UTC (rev 260910)
+++ trunk/Source/WTF/ChangeLog	2020-04-29 20:06:18 UTC (rev 260911)
@@ -1,3 +1,18 @@
+2020-04-29  Fujii Hironori  <[email protected]>
+
+        [Win] Deadlock in WTF::Thread::didExit() while WebKitNetworkProcess.exe is exiting
+        https://bugs.webkit.org/show_bug.cgi?id=210955
+
+        Reviewed by Don Olmstead.
+
+        The thread_local object of the main thread is destructed after
+        Windows terminates other threads. If the terminated thread was
+        holding a mutex, trying to lock the mutex causes deadlock.
+
+        * wtf/win/ThreadingWin.cpp:
+        (WTF::Thread::ThreadHolder::~ThreadHolder): Do nothing if the
+        thread is the main thread.
+
 2020-04-29  Jer Noble  <[email protected]>
 
         [Mac] Adopt kMTSupportNotification_ShouldPlayHDRVideoChanged notification

Modified: trunk/Source/WTF/wtf/win/ThreadingWin.cpp (260910 => 260911)


--- trunk/Source/WTF/wtf/win/ThreadingWin.cpp	2020-04-29 19:38:11 UTC (rev 260910)
+++ trunk/Source/WTF/wtf/win/ThreadingWin.cpp	2020-04-29 20:06:18 UTC (rev 260911)
@@ -267,6 +267,12 @@
 struct Thread::ThreadHolder {
     ~ThreadHolder()
     {
+        // The thread_local object of the main thread is destructed
+        // after Windows terminates other threads. If the terminated
+        // thread was holding a mutex, trying to lock the mutex causes
+        // deadlock.
+        if (isMainThread())
+            return;
         if (thread) {
             thread->specificStorage().destroySlots();
             thread->didExit();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to