summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/StateQueue.h
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2014-07-16 12:13:16 -0700
committerHans Boehm <hboehm@google.com>2014-07-23 16:14:22 -0700
commitf39b560952d3706a7ff47ef0d82c1a836daeea42 (patch)
tree931d10307a6eff848328792bf93eb71bcb665cc8 /services/audioflinger/StateQueue.h
parent7878f087b0f3737a270b242763e97d1a4e059672 (diff)
downloadframeworks_av-f39b560952d3706a7ff47ef0d82c1a836daeea42.zip
frameworks_av-f39b560952d3706a7ff47ef0d82c1a836daeea42.tar.gz
frameworks_av-f39b560952d3706a7ff47ef0d82c1a836daeea42.tar.bz2
Remove 64-bit android_atomic uses from StateQueue.
Use stdatomic.h instead. We're trying to remove android_atomic use wherever possible. The 64-bit uses seem easiest to remove first. This cleans up the code, though not as much as C++ <atomic> would, if it worked everywhere. Change-Id: I3c29bdbd5915cb9d47118834a3a742fe296cf87f
Diffstat (limited to 'services/audioflinger/StateQueue.h')
-rw-r--r--services/audioflinger/StateQueue.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/audioflinger/StateQueue.h b/services/audioflinger/StateQueue.h
index 9cde642..ef01df7 100644
--- a/services/audioflinger/StateQueue.h
+++ b/services/audioflinger/StateQueue.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_AUDIO_STATE_QUEUE_H
#define ANDROID_AUDIO_STATE_QUEUE_H
+#include <stdatomic.h>
+
// The state queue template class was originally driven by this use case / requirements:
// There are two threads: a fast mixer, and a normal mixer, and they share state.
// The interesting part of the shared state is a set of active fast tracks,
@@ -184,7 +186,7 @@ private:
T mStates[kN]; // written by mutator, read by observer
// "volatile" is meaningless with SMP, but here it indicates that we're using atomic ops
- volatile const T* mNext; // written by mutator to advance next, read by observer
+ atomic_uintptr_t mNext; // written by mutator to advance next, read by observer
volatile const T* mAck; // written by observer to acknowledge advance of next, read by mutator
// only used by observer