• Clemens Backes's avatar
    [platform] Fix data race on DefaultJobState::priority_ · 35cc3da9
    Clemens Backes authored
    The {priority_} field is being updated in {DefaultJobState::Join}, under
    {mutex_}. In other places though, it is read unprotected (without
    holding the mutex), leading to data races.
    This CL fixes that by reading the field while holding the mutex and
    using the read priority after releasing the mutex.
    
    Note that the {priority_} field is documented to be protected by
    {mutex_}, so the unprotected read was a bug.
    
    R=ulan@chromium.org
    CC=etiennep@chromium.org
    
    Bug: v8:10822
    Change-Id: I80079f3cb6689e26116ffeb33755c6938c4a2cf1
    Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel_ng
    Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel_ng
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2377685Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69571}
    35cc3da9
default-job.h 4.37 KB