Title: [210237] trunk/Source/_javascript_Core
- Revision
- 210237
- Author
- [email protected]
- Date
- 2017-01-03 02:24:38 -0800 (Tue, 03 Jan 2017)
Log Message
[Win] jsc.exe sometimes never exits.
https://bugs.webkit.org/show_bug.cgi?id=158073
Reviewed by Darin Adler.
On Windows the thread specific destructor is also called when the main thread is exiting.
This may lead to the main thread waiting forever for the machine thread lock when exiting,
if the sampling profiler thread was terminated by the system while holding the machine
thread lock.
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::removeThread):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (210236 => 210237)
--- trunk/Source/_javascript_Core/ChangeLog 2017-01-03 10:05:52 UTC (rev 210236)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-01-03 10:24:38 UTC (rev 210237)
@@ -1,3 +1,18 @@
+2017-01-03 Per Arne Vollan <[email protected]>
+
+ [Win] jsc.exe sometimes never exits.
+ https://bugs.webkit.org/show_bug.cgi?id=158073
+
+ Reviewed by Darin Adler.
+
+ On Windows the thread specific destructor is also called when the main thread is exiting.
+ This may lead to the main thread waiting forever for the machine thread lock when exiting,
+ if the sampling profiler thread was terminated by the system while holding the machine
+ thread lock.
+
+ * heap/MachineStackMarker.cpp:
+ (JSC::MachineThreads::removeThread):
+
2017-01-02 Julien Brianceau <[email protected]>
Remove sh4 specific code from _javascript_Core
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (210236 => 210237)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2017-01-03 10:05:52 UTC (rev 210236)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2017-01-03 10:24:38 UTC (rev 210237)
@@ -32,6 +32,7 @@
#include "VM.h"
#include <setjmp.h>
#include <stdlib.h>
+#include <wtf/MainThread.h>
#include <wtf/StdLibExtras.h>
#if OS(DARWIN)
@@ -276,6 +277,17 @@
// to be instantiated at the same address. Hence, this thread may or
// may not be found in this MachineThreads registry. We only need to
// do a removal if this thread is found in it.
+
+#if PLATFORM(WIN)
+ // On Windows the thread specific destructor is also called when the
+ // main thread is exiting. This may lead to the main thread waiting
+ // forever for the machine thread lock when exiting, if the sampling
+ // profiler thread was terminated by the system while holding the
+ // machine thread lock.
+ if (WTF::isMainThread())
+ return;
+#endif
+
machineThreads->removeThreadIfFound(getCurrentPlatformThread());
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes