Remove 'volatile' from mMute and add comments
Change-Id: I386ba27b2305a397aba70331c6bf0d35ea727cf6
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 30915a8..29c1d9b 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -789,10 +789,14 @@
void triggerEvents(AudioSystem::sync_event_t type);
virtual bool isTimedTrack() const { return false; }
bool isFastTrack() const { return (mFlags & IAudioFlinger::TRACK_FAST) != 0; }
+
protected:
- // we don't really need a lock for these
- volatile bool mMute;
+ // written by Track::mute() called by binder thread(s), without a mutex or barrier.
+ // read by Track::isMuted() called by playback thread, also without a mutex or barrier.
+ // The lack of mutex or barrier is safe because the mute status is only used by itself.
+ bool mMute;
+
// FILLED state is used for suppressing volume ramp at begin of playing
enum {FS_INVALID, FS_FILLING, FS_FILLED, FS_ACTIVE};
mutable uint8_t mFillingUpStatus;