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

Issue 611373003: Add a mutex lock to AudioPowerMonitor::Reset() to placate TSAN. (Closed)

Created:
6 years, 2 months ago by miu
Modified:
6 years, 2 months ago
Reviewers:
DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add a mutex lock to AudioPowerMonitor::Reset() to placate TSAN. Since Reset() is not a high-performance code path, it's acceptable to add the extra mutex lock while resetting all the member variables. By design, it was not actually harmful that ReadCurrentPowerAndClip() was making a racey read. BUG=418290 Committed: https://crrev.com/a63a57f288c10e746c5623b86446a663eb5d683d Cr-Commit-Position: refs/heads/master@{#297545}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Clarify variable read/write safety in Reset() method. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -2 lines) Patch
M media/audio/audio_power_monitor.cc View 1 1 chunk +11 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
miu
One liner to fix a TSAN race bug. PTAL.
6 years, 2 months ago (2014-09-30 20:09:14 UTC) #2
DaleCurtis
https://codereview.chromium.org/611373003/diff/1/media/audio/audio_power_monitor.cc File media/audio/audio_power_monitor.cc (right): https://codereview.chromium.org/611373003/diff/1/media/audio/audio_power_monitor.cc#newcode57 media/audio/audio_power_monitor.cc:57: average_power_ = std::max(0.0f, std::min(1.0f, sum_power / num_channels)); average power ...
6 years, 2 months ago (2014-09-30 20:10:50 UTC) #3
miu
https://codereview.chromium.org/611373003/diff/1/media/audio/audio_power_monitor.cc File media/audio/audio_power_monitor.cc (right): https://codereview.chromium.org/611373003/diff/1/media/audio/audio_power_monitor.cc#newcode57 media/audio/audio_power_monitor.cc:57: average_power_ = std::max(0.0f, std::min(1.0f, sum_power / num_channels)); On 2014/09/30 ...
6 years, 2 months ago (2014-09-30 21:14:22 UTC) #4
DaleCurtis
OIC, my bad, lgtm!
6 years, 2 months ago (2014-09-30 21:22:45 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/611373003/20001
6 years, 2 months ago (2014-09-30 21:58:40 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001) as d391c014f602975a4b45ed30770136792d743dc8
6 years, 2 months ago (2014-09-30 23:36:49 UTC) #8
commit-bot: I haz the power
6 years, 2 months ago (2014-09-30 23:38:12 UTC) #9
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/a63a57f288c10e746c5623b86446a663eb5d683d
Cr-Commit-Position: refs/heads/master@{#297545}

Powered by Google App Engine
This is Rietveld 408576698