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

Unified Diff: webrtc/modules/audio_device/ios/audio_device_ios.h

Issue 1420043008: Create rtc::AtomicInt POD struct. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: intentional obliteration of the unintentional whitespace of doom Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/refcount.h ('k') | webrtc/modules/audio_device/ios/audio_device_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/audio_device_ios.h
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.h b/webrtc/modules/audio_device/ios/audio_device_ios.h
index 8f8ba0a9c53ce7c6cd059885f3e241829bf01dea..784070b6d9f1abac610dcac58f7a40e7799a274f 100644
--- a/webrtc/modules/audio_device/ios/audio_device_ios.h
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.h
@@ -13,6 +13,7 @@
#include <AudioUnit/AudioUnit.h>
+#include "webrtc/base/atomicops.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_checker.h"
#include "webrtc/modules/audio_device/audio_device_generic.h"
@@ -53,11 +54,15 @@ class AudioDeviceIOS : public AudioDeviceGeneric {
int32_t StartPlayout() override;
int32_t StopPlayout() override;
- bool Playing() const override { return playing_; }
+ bool Playing() const override {
+ return rtc::AtomicInt::AcquireLoad(&playing_) != 0;
+ }
int32_t StartRecording() override;
int32_t StopRecording() override;
- bool Recording() const override { return recording_; }
+ bool Recording() const override {
+ return rtc::AtomicInt::AcquireLoad(&recording_) != 0;
+ }
int32_t SetLoudspeakerStatus(bool enable) override;
int32_t GetLoudspeakerStatus(bool& enabled) const override;
@@ -268,10 +273,10 @@ class AudioDeviceIOS : public AudioDeviceGeneric {
rtc::scoped_ptr<SInt8[]> record_audio_buffer_;
// Set to 1 when recording is active and 0 otherwise.
- volatile int recording_;
+ rtc::AtomicInt recording_;
// Set to 1 when playout is active and 0 otherwise.
- volatile int playing_;
+ rtc::AtomicInt playing_;
// Set to true after successful call to Init(), false otherwise.
bool initialized_;
« no previous file with comments | « webrtc/base/refcount.h ('k') | webrtc/modules/audio_device/ios/audio_device_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698