Title: [183526] trunk/Source/_javascript_Core
Revision
183526
Author
commit-qu...@webkit.org
Date
2015-04-28 20:56:47 -0700 (Tue, 28 Apr 2015)

Log Message

Deadlock on applications using JSContext on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=144370

Patch by Joseph Pecoraro <pecor...@apple.com> on 2015-04-28
Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::singleton):
Prevent a possible deadlock by assuming we can synchronously
run something on the main queue at this time.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (183525 => 183526)


--- trunk/Source/_javascript_Core/ChangeLog	2015-04-29 03:34:43 UTC (rev 183525)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-04-29 03:56:47 UTC (rev 183526)
@@ -1,3 +1,15 @@
+2015-04-28  Joseph Pecoraro  <pecor...@apple.com>
+
+        Deadlock on applications using JSContext on non-main thread
+        https://bugs.webkit.org/show_bug.cgi?id=144370
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::singleton):
+        Prevent a possible deadlock by assuming we can synchronously
+        run something on the main queue at this time.
+
 2015-04-28  Filip Pizlo  <fpi...@apple.com>
 
         FTL should fully support Switch (it currently lacks the SwitchString variant)

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm (183525 => 183526)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2015-04-29 03:34:43 UTC (rev 183525)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2015-04-29 03:56:47 UTC (rev 183526)
@@ -93,8 +93,12 @@
 
             if ([NSThread isMainThread])
                 initialize();
-            else
-                dispatch_sync(dispatch_get_main_queue(), initialize);
+            else {
+                // FIXME: This means that we may miss an auto-attach to a JSContext created on a non-main thread.
+                // The main thread initialization is required for certain WTF values that need to be initialized
+                // on the "real" main thread. We should investigate a better way to handle this.
+                dispatch_async(dispatch_get_main_queue(), initialize);
+            }
         }
     });
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to