• mlippautz's avatar
    Fix protocol for aborting and waiting for cancelable tasks. · a698fd84
    mlippautz authored
    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
    
    Review URL: https://codereview.chromium.org/1460763004
    
    Cr-Commit-Position: refs/heads/master@{#32118}
    a698fd84
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...