This causes VoiceOver to become irresponsive.
<rdar://problem/97982075>
Created attachment 461361 [details] Patch
Comment on attachment 461361 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461361&action=review I didn’t get a chance to review the whole thing, but a couple comments. > Source/WebCore/accessibility/AccessibilityObjectInterface.h:1695 > +T retrieveValueFromMainThreadWithTimeout(U&& function, Seconds&& timeout) Since Seconds is a class wrapping a double, we can just use Seconds, we don’t need to use Seconds&&. > Source/WebCore/accessibility/AccessibilityObjectInterface.h:1708 > + while (!done && !hasElapsed(elapseTime)) { } This kind of loop is not an efficient way to have one thread wait on another. Surely there is a better idiom for such things using locks, mutexes, or semaphores of some kind.
Created attachment 461559 [details] Patch Extended the check for whether to dispatch to the main thread to all AXIsolatedObject methods that were using Accessibility::retrieveValueFromMainThread.
(In reply to Darin Adler from comment #3) > Comment on attachment 461361 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=461361&action=review > > I didn’t get a chance to review the whole thing, but a couple comments. > > > Source/WebCore/accessibility/AccessibilityObjectInterface.h:1695 > > +T retrieveValueFromMainThreadWithTimeout(U&& function, Seconds&& timeout) > > Since Seconds is a class wrapping a double, we can just use Seconds, we > don’t need to use Seconds&&. Fixed. > > > Source/WebCore/accessibility/AccessibilityObjectInterface.h:1708 > > + while (!done && !hasElapsed(elapseTime)) { } > > This kind of loop is not an efficient way to have one thread wait on > another. Surely there is a better idiom for such things using locks, > mutexes, or semaphores of some kind. Yes, still working on that. I'm getting deadlocks using BinarySemaphore that I'm still debugging. I'm keeping this for now so that it is testable but not the final version yet. Thanks!