|
Make 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
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+84 lines, -44 lines) |
Patch |
 |
M |
base/message_loop/message_loop.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump.h
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_android.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_android.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_default.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_default.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_glib.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_glib.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_libevent.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_libevent.cc
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_mac.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_mac.mm
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_win.h
|
View
|
|
5 chunks |
+10 lines, -4 lines |
0 comments
|
Download
|
 |
M |
base/message_loop/message_pump_win.cc
|
View
|
1
|
5 chunks |
+45 lines, -9 lines |
0 comments
|
Download
|
 |
M |
tools/valgrind/tsan/suppressions.txt
|
View
|
|
1 chunk |
+0 lines, -31 lines |
0 comments
|
Download
|
Total messages: 16 (0 generated)
|