DescriptionOilpan: Fix worker thread termination finalization order issues.
We need to carry out the nullptr assignment to m_workerGlobalScope
before notifying the proxy that the worker thread is going away.
Otherwise, the main thread could destroy the WorkerThread object
which owns the m_workerGlobalScope persistent before the assignment
and that would lead to a use-after-free.
It turns out that there are objects that keep the execution context
alive in order to be able to determine if they are being destructed
on the right thread. Therefore, clearing out the thread member
in WorkerGlobalScope cannot be done before the WorkerGlobalScope
is actually dead. Therefore, the larger change that Sigbjorn did
will not work. (One example of this kind of dependency is
SQLCallbackWrapper.)
We need to just keep the thread member intact and let objects
die normally. The call to detach needs to happen before we
actually kill the worker thread because finalizers need to
be able to access thread local data.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169460
Patch Set 1 #
Total comments: 2
Patch Set 2 : Add back comment about not clearing m_thread #
Total comments: 2
Patch Set 3 : Update comment. #
Messages
Total messages: 17 (0 generated)
|