commit | 0c11cb0b9692816f4b4f615bf3ac31e4df6f7a75 | [log] [tgz] |
---|---|---|
author | Ryan Savitski <rsavitski@google.com> | Mon Mar 18 18:18:16 2019 +0000 |
committer | Ryan Savitski <rsavitski@google.com> | Mon Mar 18 18:18:16 2019 +0000 |
tree | 5d48dde5f68bb725712ba6bb703c65c8b1dd9c52 | |
parent | ba2b5c5132770b930763bc4d96cc433fcf3e5660 [diff] |
UnixTaskRunner.Quit: keep holding lock while notifying to prevent race Currently, we unlock after setting the |quit_| flag, but before notifying. Therefore, if woken up for other reasons, the task runner can quit its Run() loop before the notify happens (and while the original thread is still inside Quit()). This is unexpected, and opens up a data race in ThreadTaskRunner's usage of this class (caught by tsan). Change-Id: Ibf398af3243d9bd1d8fae97b9c228626ef5f317e
Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.
See www.perfetto.dev for docs.