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

Unified Diff: media/base/audio_fifo.h

Issue 337163004: Remove the atomic operations from media::AudioFifo, making it truly thread-unsafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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 | « no previous file | media/base/audio_fifo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_fifo.h
diff --git a/media/base/audio_fifo.h b/media/base/audio_fifo.h
index e978ace05ba5c4271b2d4e0b440959339d5a858e..c00dd40fef9c99b202e18c35cbce7d09b69e4eea 100644
--- a/media/base/audio_fifo.h
+++ b/media/base/audio_fifo.h
@@ -5,7 +5,6 @@
#ifndef MEDIA_BASE_AUDIO_FIFO_H_
#define MEDIA_BASE_AUDIO_FIFO_H_
-#include "base/atomicops.h"
#include "media/base/audio_bus.h"
#include "media/base/media_export.h"
@@ -15,8 +14,7 @@ namespace media {
// The maximum number of audio frames in the FIFO is set at construction and
// can not be extended dynamically. The allocated memory is utilized as a
// ring buffer.
-// This class is thread-safe in the limited sense that one thread may call
-// Push(), while a second thread calls Consume().
+// This class is thread-unsafe.
class MEDIA_EXPORT AudioFifo {
public:
// Creates a new AudioFifo and allocates |channels| of length |frames|.
@@ -51,8 +49,8 @@ class MEDIA_EXPORT AudioFifo {
const int max_frames_;
// Number of actual elements in the FIFO.
- volatile base::subtle::Atomic32 frames_pushed_;
- volatile base::subtle::Atomic32 frames_consumed_;
+ int frames_pushed_;
+ int frames_consumed_;
// Current read position.
int read_pos_;
« no previous file with comments | « no previous file | media/base/audio_fifo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698