DescriptionFix protocol for aborting and waiting for cancelable tasks.
Since {CancelAndWait} blocks on the tasks that are still present in the internal
hashmap, we are not allowed to remove the task upon trying to cancel it using
{TryAbort}.
The previous implementation suffered from a bug where:
1) The task was created and handed over to the platform.
2) The task was started by the platform, setting it to running state.
3) We called {TryAbort}, effectively removing it from the manager, but failing
to cancel (as it was already running)
4) All tasks finished running, indicating this with their own semaphore.
5) The platform was stuck (scheduling) before destroying the task.
6) Main thread finished its work, waiting for all the necessary tasks, and the
isolate terminated.
7) The platform destroyed the task, calling the destructor, calling into an
already freed isolate.
BUG=chromium:524425
LOG=N
Committed: https://crrev.com/a698fd849bba5df74a44b31e284ec45362f33c12
Cr-Commit-Position: refs/heads/master@{#32118}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Addressed comments #
Messages
Total messages: 10 (5 generated)
|