<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Modern IDB: TransactionOperations from a worker thread might be destroyed on main thread"
href="https://bugs.webkit.org/show_bug.cgi?id=158004#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Modern IDB: TransactionOperations from a worker thread might be destroyed on main thread"
href="https://bugs.webkit.org/show_bug.cgi?id=158004">bug 158004</a>
from <span class="vcard"><a class="email" href="mailto:beidson@apple.com" title="Brady Eidson <beidson@apple.com>"> <span class="fn">Brady Eidson</span></a>
</span></b>
<pre>We definitely need to destroy these things on the worker thread. Tragic things might happen if we don't.
Each WorkerThread has a WorkerRunLoop, which handles ScriptExecutionContext::Tasks nonstop, and a WTF::RunLoop, which is normal 100% tied up running the WorkerRunLoop.
There's a few inherent races on the main thread here.
The main thread can check if the ScriptExecutionContext still exists and, if so, post a task to it. Problem is that by the time it posts the task, the ScriptExecutionContext might have been terminated (in a normal bad case) or even destroyed (in a tragic bad case)
Assuming that problem is solved, and we reliably check if the ScriptExecutionContext is still there, discover it's not, and then decide to post to the WorkerThread's WTF::RunLoop, there's no guarantee the RunLoop is still running and accepting tasks.
Some re-architecting will be necessary here.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>