|
Attempting to resolve a race condition with PowerMonitor.
ThreadSanitizer caught multiple instances where PowerMonitor::Get or PowerMonitor::Add/RemoveObserver were being called concurrently with the PowerMonitor constructor in the main thread. These functions access a process-global PowerMontior instance (g_power_monitor), which was not thread safe.
This change adds locks around PowerMonitor creation and deletion, and forces Add/RemoveObserver to be called in a threadsafe manner. It also removes the need to call PowerMonitor::Get.
BUG= 268924
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262018
Total comments: 2
Total comments: 1
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+142 lines, -122 lines) |
Patch |
|
M |
base/power_monitor/power_monitor.h
|
View
|
1
2
3
|
2 chunks |
+15 lines, -15 lines |
0 comments
|
Download
|
|
M |
base/power_monitor/power_monitor.cc
|
View
|
1
2
3
|
1 chunk |
+71 lines, -22 lines |
0 comments
|
Download
|
|
M |
base/power_monitor/power_monitor_source.h
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
base/power_monitor/power_monitor_source.cc
|
View
|
1
2
3
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
base/power_monitor/power_monitor_unittest.cc
|
View
|
1
2
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
base/timer/hi_res_timer_manager_unittest.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
base/timer/hi_res_timer_manager_win.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/event_router_forwarder_unittest.cc
|
View
|
1
2
3
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
|
M |
components/nacl/loader/nacl_helper_win_64.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
components/nacl/loader/nacl_main.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
content/browser/browser_main_loop.h
|
View
|
1
2
3
|
2 chunks |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/browser_main_loop.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/power_monitor_message_broadcaster.cc
|
View
|
1
|
1 chunk |
+2 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/browser/power_monitor_message_broadcaster_unittest.cc
|
View
|
1
2
|
1 chunk |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/renderer_host/media/media_stream_manager.cc
|
View
|
1
2
3
|
2 chunks |
+2 lines, -10 lines |
0 comments
|
Download
|
|
M |
content/child/child_thread.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/child/child_thread.cc
|
View
|
1
2
3
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/child/power_monitor_broadcast_source_unittest.cc
|
View
|
1
2
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/gpu/gpu_watchdog_thread.cc
|
View
|
1
|
2 chunks |
+2 lines, -6 lines |
0 comments
|
Download
|
|
M |
media/audio/mac/audio_manager_mac.cc
|
View
|
1
2
3
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
net/http/http_network_layer.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -6 lines |
0 comments
|
Download
|
|
M |
net/url_request/url_request_job.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+2 lines, -8 lines |
0 comments
|
Download
|
Total messages: 41 (0 generated)
|