Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Issue 10905237: Fix a potential multi-thread issue when manipulating removable storage map (Closed)

Created:
8 years, 3 months ago by Hongbo Min
Modified:
7 years, 11 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Fix a potential multi-thread issue when manipulating removable storage map TBR=willchan@chromium.org BUG=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=156486

Patch Set 1 #

Total comments: 4

Patch Set 2 : use mutable for lock #

Patch Set 3 : use mutable for lock #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -10 lines) Patch
M base/system_monitor/system_monitor.h View 1 2 2 chunks +3 lines, -0 lines 2 comments Download
M base/system_monitor/system_monitor.cc View 1 1 chunk +18 lines, -10 lines 5 comments Download

Messages

Total messages: 14 (0 generated)
Hongbo Min
vandebo, Since the removable_storage_map_ may be manipulated from more than one thread, we need to ...
8 years, 3 months ago (2012-09-12 14:04:20 UTC) #1
vandebo (ex-Chrome)
LGTM Will, this is what we talked about so TBRing you.
8 years, 3 months ago (2012-09-12 16:56:46 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hongbo.min@intel.com/10905237/1
8 years, 3 months ago (2012-09-12 16:57:04 UTC) #3
willchan no longer on Chromium
Minor nit, which doesn't really matter since I think everyone always has access to a ...
8 years, 3 months ago (2012-09-12 17:00:45 UTC) #4
vandebo (ex-Chrome)
http://codereview.chromium.org/10905237/diff/1/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10905237/diff/1/base/system_monitor/system_monitor.h#newcode11 base/system_monitor/system_monitor.h:11: Should include the lock header. http://codereview.chromium.org/10905237/diff/1/base/system_monitor/system_monitor.h#newcode98 base/system_monitor/system_monitor.h:98: std::vector<RemovableStorageInfo> GetAttachedRemovableStorage(); ...
8 years, 3 months ago (2012-09-12 17:12:57 UTC) #5
Hongbo Min
vandebo, does it LGTM again now? If yes, please help check the commit box. Thanks.
8 years, 3 months ago (2012-09-13 00:02:12 UTC) #6
vandebo (ex-Chrome)
LGTM
8 years, 3 months ago (2012-09-13 00:43:30 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hongbo.min@intel.com/10905237/2003
8 years, 3 months ago (2012-09-13 00:46:30 UTC) #8
commit-bot: I haz the power
Try job failure for 10905237-2003 (retry) on win for step "runhooks" (clobber build). It's a ...
8 years, 3 months ago (2012-09-13 01:04:55 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hongbo.min@intel.com/10905237/2003
8 years, 3 months ago (2012-09-13 01:07:10 UTC) #10
commit-bot: I haz the power
Change committed as 156486
8 years, 3 months ago (2012-09-13 03:14:20 UTC) #11
Philippe
Hi guys, The threading guarantees of this class are not really clear. I would like ...
8 years ago (2012-12-14 13:53:03 UTC) #12
Hongbo Min
Hi, Philippe, I still have no much idea about the design rationale of SystemMonitor, and ...
8 years ago (2012-12-15 14:03:27 UTC) #13
vandebo (ex-Chrome)
7 years, 11 months ago (2013-01-04 19:46:54 UTC) #14
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/10905237/diff/2003/base/system_monitor...
File base/system_monitor/system_monitor.cc (right):

https://chromiumcodereview.appspot.com/10905237/diff/2003/base/system_monitor...
base/system_monitor/system_monitor.cc:17: static SystemMonitor* g_system_monitor
= NULL;
On 2012/12/14 13:53:03, Philippe wrote:
> Could we use a leaky lazy instance here? I'm concerned about uses after free.
> The Get() method below could make the client think that he can safely access
the
> instance at any time from any thread.

g_system_monitor will go away during the refactor.

https://chromiumcodereview.appspot.com/10905237/diff/2003/base/system_monitor...
base/system_monitor/system_monitor.cc:70: void
SystemMonitor::ProcessPowerMessage(PowerEvent event_id) {
On 2012/12/14 13:53:03, Philippe wrote:
> I believe this function is supposed to be callable from any thread, right?
> It's accessing some state without any kind of synchronization.

This function will go away in the refactor, but it should only be called from a
single thread.

https://chromiumcodereview.appspot.com/10905237/diff/2003/base/system_monitor...
File base/system_monitor/system_monitor.h (right):

https://chromiumcodereview.appspot.com/10905237/diff/2003/base/system_monitor...
base/system_monitor/system_monitor.h:108: // Using a lock here is not necessary
for just a bool.
On 2012/12/14 13:53:03, Philippe wrote:
> This is wrong on ARM multi cores.

Feel free to fix.

Powered by Google App Engine
This is Rietveld 408576698