DescriptionFix a "benign" data race during thread construction
This patch fixes data race on Thread::task_runner() which happens during thread
creation:
Origin thread New thread
------------- ----------
1. Construct a Thread
|
'-----------------------------.
|
V
3. Call Thread::task_runner() 2. Bind the message loop on the thread
=> MessageLoop::task_runner() => MessageLoop::SetTaskRunner()
Steps 2 and 3 introduce a data race with one thread reading the task runner
pointer and the other writing to it.
The race is "benign" because the new thread is setting
MessageLoop::task_runner_ to the same value it already has (it is also
initialized in the constructor).
This patch fixes the problem by not unnecessarily writing to the task runner.
BUG=508789
Patch Set 1 #
Total comments: 3
Depends on Patchset: Messages
Total messages: 6 (1 generated)
|