DescriptionMake sure that the UI window created by base::MessagePumpForUI is destoyed on the same thread (Windows).
Currently the window created base::MessagePumpForUI can be destroyed on a wrong thread. base::MessagePumpForUI is a ref-counted class so it can (and does) outlive the owning base::MessageLoop. As the result DestroyWindow() can be called on a wrong thread. This makes TSAN unhappy and it reports races deep unside user32.dll.
Changes in this CL:
- The message pump is now notified when the owning message loop is being destroyed. The notification is used to free all resources that hve to be released on the base::MessageLoop's thread.
- MessagePumpForUI::ScheduleWork() synchronizes access to the message-only window handle to avoid posting messages to the window during or after its destruction.
BUG=241939
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=207278
Patch Set 1 #
Total comments: 12
Patch Set 2 : rebased #
Total comments: 4
Patch Set 3 : CR feedback. #Patch Set 4 : The lock is back. #Patch Set 5 : oops #
Total comments: 6
Patch Set 6 : CR feedback. #
Total comments: 4
Patch Set 7 : CR feedback. #Patch Set 8 : rebased #
Total comments: 2
Patch Set 9 : Updated comments. #Patch Set 10 : rebased #Messages
Total messages: 27 (0 generated)
|