Files
tubestation/dom/file
Nika Layzell c4f7af5e79 Bug 1929095 - Unlock FileBlobImpl::mMutex when spinning a nested event loop, r=asuth
Before this change, we would hold the FileBlobImpl::mMutex lock while
dispatching a synchronous worker runnable to the main thread from a
worker. This could lead to a deadlock, due to other events happening
while the lock is held which could both attempt to acquire the lock, as
well as block the lock from being unlocked.

This patch simplifies the logic, unlocking the mutex during the dispatch
and re-locking it for individual operations, to avoid this potential
issue.

This should be OK even if multiple worker threads are attempting to get
the type of the same file at the same time, as additional
`GetTypeRunnable` calls dispatched to the main thread will end up being
no-ops.

Differential Revision: https://phabricator.services.mozilla.com/D227993
2024-11-12 16:57:59 +00:00
..