Loading media/libmedia/AudioTrackShared.cpp +31 −31 Original line number Original line Diff line number Diff line Loading @@ -19,9 +19,9 @@ #include <private/media/AudioTrackShared.h> #include <private/media/AudioTrackShared.h> #include <utils/Log.h> #include <utils/Log.h> extern "C" { #include "../private/bionic_futex.h" #include <linux/futex.h> } #include <sys/syscall.h> namespace android { namespace android { Loading Loading @@ -206,12 +206,12 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques } } int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { int rc; if (measure && !beforeIsValid) { if (measure && !beforeIsValid) { clock_gettime(CLOCK_MONOTONIC, &before); clock_gettime(CLOCK_MONOTONIC, &before); beforeIsValid = true; beforeIsValid = true; } } int ret = __futex_syscall4(&cblk->mFutex, errno = 0; (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); // update total elapsed time spent waiting // update total elapsed time spent waiting if (measure) { if (measure) { Loading @@ -230,16 +230,16 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques before = after; before = after; beforeIsValid = true; beforeIsValid = true; } } switch (ret) { switch (errno) { case 0: // normal wakeup by server, or by binderDied() case 0: // normal wakeup by server, or by binderDied() case -EWOULDBLOCK: // benign race condition with server case EWOULDBLOCK: // benign race condition with server case -EINTR: // wait was interrupted by signal or other spurious wakeup case EINTR: // wait was interrupted by signal or other spurious wakeup case -ETIMEDOUT: // time-out expired case ETIMEDOUT: // time-out expired // FIXME these error/non-0 status are being dropped // FIXME these error/non-0 status are being dropped break; break; default: default: ALOGE("%s unexpected error %d", __func__, ret); status = errno; status = -ret; ALOGE("%s unexpected error %s", __func__, strerror(status)); goto end; goto end; } } } } Loading Loading @@ -295,8 +295,8 @@ void ClientProxy::binderDied() audio_track_cblk_t* cblk = mCblk; audio_track_cblk_t* cblk = mCblk; if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) { if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) { // it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process // it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process (void) __futex_syscall4(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); 1); } } } } Loading @@ -304,8 +304,8 @@ void ClientProxy::interrupt() { { audio_track_cblk_t* cblk = mCblk; audio_track_cblk_t* cblk = mCblk; if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) { if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) { (void) __futex_syscall4(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); 1); } } } } Loading Loading @@ -435,18 +435,18 @@ status_t AudioTrackClientProxy::waitStreamEndDone(const struct timespec *request } } int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { int rc; errno = 0; int ret = __futex_syscall4(&cblk->mFutex, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); switch (ret) { switch (errno) { case 0: // normal wakeup by server, or by binderDied() case 0: // normal wakeup by server, or by binderDied() case -EWOULDBLOCK: // benign race condition with server case EWOULDBLOCK: // benign race condition with server case -EINTR: // wait was interrupted by signal or other spurious wakeup case EINTR: // wait was interrupted by signal or other spurious wakeup case -ETIMEDOUT: // time-out expired case ETIMEDOUT: // time-out expired break; break; default: default: ALOGE("%s unexpected error %d", __func__, ret); status = errno; status = -ret; ALOGE("%s unexpected error %s", __func__, strerror(status)); goto end; goto end; } } } } Loading Loading @@ -535,8 +535,8 @@ status_t ServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush) if (front != rear) { if (front != rear) { int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { (void) __futex_syscall4(&cblk->mFutex, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } } } front = rear; front = rear; Loading Loading @@ -638,8 +638,8 @@ void ServerProxy::releaseBuffer(Buffer* buffer) ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum); ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { (void) __futex_syscall4(&cblk->mFutex, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } } } Loading Loading @@ -682,8 +682,8 @@ bool AudioTrackServerProxy::setStreamEndDone() { bool old = bool old = (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0; (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0; if (!old) { if (!old) { (void) __futex_syscall4(&mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, (void) syscall(__NR_futex, &mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); 1); } } return old; return old; } } Loading services/audioflinger/FastMixer.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -179,7 +179,7 @@ bool FastMixer::threadLoop() ALOG_ASSERT(coldFutexAddr != NULL); ALOG_ASSERT(coldFutexAddr != NULL); int32_t old = android_atomic_dec(coldFutexAddr); int32_t old = android_atomic_dec(coldFutexAddr); if (old <= 0) { if (old <= 0) { __futex_syscall4(coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1, NULL); (void) syscall(__NR_futex, coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1); } } int policy = sched_getscheduler(0); int policy = sched_getscheduler(0); if (!(policy == SCHED_FIFO || policy == SCHED_RR)) { if (!(policy == SCHED_FIFO || policy == SCHED_RR)) { Loading services/audioflinger/FastMixer.h +2 −3 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,10 @@ #ifndef ANDROID_AUDIO_FAST_MIXER_H #ifndef ANDROID_AUDIO_FAST_MIXER_H #define ANDROID_AUDIO_FAST_MIXER_H #define ANDROID_AUDIO_FAST_MIXER_H #include <linux/futex.h> #include <sys/syscall.h> #include <utils/Debug.h> #include <utils/Debug.h> #include <utils/Thread.h> #include <utils/Thread.h> extern "C" { #include "../private/bionic_futex.h" } #include "StateQueue.h" #include "StateQueue.h" #include "FastMixerState.h" #include "FastMixerState.h" Loading services/audioflinger/Threads.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -2603,7 +2603,7 @@ AudioFlinger::MixerThread::~MixerThread() if (state->mCommand == FastMixerState::COLD_IDLE) { if (state->mCommand == FastMixerState::COLD_IDLE) { int32_t old = android_atomic_inc(&mFastMixerFutex); int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { if (old == -1) { __futex_syscall4(&mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1, NULL); (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); } } } } state->mCommand = FastMixerState::EXIT; state->mCommand = FastMixerState::EXIT; Loading Loading @@ -2660,7 +2660,7 @@ ssize_t AudioFlinger::MixerThread::threadLoop_write() if (state->mCommand == FastMixerState::COLD_IDLE) { if (state->mCommand == FastMixerState::COLD_IDLE) { int32_t old = android_atomic_inc(&mFastMixerFutex); int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { if (old == -1) { __futex_syscall4(&mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1, NULL); (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); } } #ifdef AUDIO_WATCHDOG #ifdef AUDIO_WATCHDOG if (mAudioWatchdog != 0) { if (mAudioWatchdog != 0) { Loading services/audioflinger/Tracks.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "Configuration.h" #include "Configuration.h" #include <math.h> #include <math.h> #include <sys/syscall.h> #include <utils/Log.h> #include <utils/Log.h> #include <private/media/AudioTrackShared.h> #include <private/media/AudioTrackShared.h> Loading Loading @@ -952,7 +953,7 @@ void AudioFlinger::PlaybackThread::Track::invalidate() android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_release_store(0x40000000, &cblk->mFutex); android_atomic_release_store(0x40000000, &cblk->mFutex); // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE (void) __futex_syscall4(&cblk->mFutex, FUTEX_WAKE, INT_MAX, NULL); (void) syscall(__NR_futex, &cblk->mFutex, FUTEX_WAKE, INT_MAX); mIsInvalid = true; mIsInvalid = true; } } Loading Loading @@ -1839,7 +1840,7 @@ void AudioFlinger::RecordThread::RecordTrack::invalidate() android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_release_store(0x40000000, &cblk->mFutex); android_atomic_release_store(0x40000000, &cblk->mFutex); // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE (void) __futex_syscall4(&cblk->mFutex, FUTEX_WAKE, INT_MAX, NULL); (void) syscall(__NR_futex, &cblk->mFutex, FUTEX_WAKE, INT_MAX); } } Loading Loading
media/libmedia/AudioTrackShared.cpp +31 −31 Original line number Original line Diff line number Diff line Loading @@ -19,9 +19,9 @@ #include <private/media/AudioTrackShared.h> #include <private/media/AudioTrackShared.h> #include <utils/Log.h> #include <utils/Log.h> extern "C" { #include "../private/bionic_futex.h" #include <linux/futex.h> } #include <sys/syscall.h> namespace android { namespace android { Loading Loading @@ -206,12 +206,12 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques } } int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { int rc; if (measure && !beforeIsValid) { if (measure && !beforeIsValid) { clock_gettime(CLOCK_MONOTONIC, &before); clock_gettime(CLOCK_MONOTONIC, &before); beforeIsValid = true; beforeIsValid = true; } } int ret = __futex_syscall4(&cblk->mFutex, errno = 0; (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); // update total elapsed time spent waiting // update total elapsed time spent waiting if (measure) { if (measure) { Loading @@ -230,16 +230,16 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques before = after; before = after; beforeIsValid = true; beforeIsValid = true; } } switch (ret) { switch (errno) { case 0: // normal wakeup by server, or by binderDied() case 0: // normal wakeup by server, or by binderDied() case -EWOULDBLOCK: // benign race condition with server case EWOULDBLOCK: // benign race condition with server case -EINTR: // wait was interrupted by signal or other spurious wakeup case EINTR: // wait was interrupted by signal or other spurious wakeup case -ETIMEDOUT: // time-out expired case ETIMEDOUT: // time-out expired // FIXME these error/non-0 status are being dropped // FIXME these error/non-0 status are being dropped break; break; default: default: ALOGE("%s unexpected error %d", __func__, ret); status = errno; status = -ret; ALOGE("%s unexpected error %s", __func__, strerror(status)); goto end; goto end; } } } } Loading Loading @@ -295,8 +295,8 @@ void ClientProxy::binderDied() audio_track_cblk_t* cblk = mCblk; audio_track_cblk_t* cblk = mCblk; if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) { if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) { // it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process // it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process (void) __futex_syscall4(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); 1); } } } } Loading @@ -304,8 +304,8 @@ void ClientProxy::interrupt() { { audio_track_cblk_t* cblk = mCblk; audio_track_cblk_t* cblk = mCblk; if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) { if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) { (void) __futex_syscall4(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); 1); } } } } Loading Loading @@ -435,18 +435,18 @@ status_t AudioTrackClientProxy::waitStreamEndDone(const struct timespec *request } } int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { int rc; errno = 0; int ret = __futex_syscall4(&cblk->mFutex, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); switch (ret) { switch (errno) { case 0: // normal wakeup by server, or by binderDied() case 0: // normal wakeup by server, or by binderDied() case -EWOULDBLOCK: // benign race condition with server case EWOULDBLOCK: // benign race condition with server case -EINTR: // wait was interrupted by signal or other spurious wakeup case EINTR: // wait was interrupted by signal or other spurious wakeup case -ETIMEDOUT: // time-out expired case ETIMEDOUT: // time-out expired break; break; default: default: ALOGE("%s unexpected error %d", __func__, ret); status = errno; status = -ret; ALOGE("%s unexpected error %s", __func__, strerror(status)); goto end; goto end; } } } } Loading Loading @@ -535,8 +535,8 @@ status_t ServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush) if (front != rear) { if (front != rear) { int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { (void) __futex_syscall4(&cblk->mFutex, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } } } front = rear; front = rear; Loading Loading @@ -638,8 +638,8 @@ void ServerProxy::releaseBuffer(Buffer* buffer) ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum); ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { if (!(old & CBLK_FUTEX_WAKE)) { (void) __futex_syscall4(&cblk->mFutex, (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } } } Loading Loading @@ -682,8 +682,8 @@ bool AudioTrackServerProxy::setStreamEndDone() { bool old = bool old = (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0; (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0; if (!old) { if (!old) { (void) __futex_syscall4(&mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, (void) syscall(__NR_futex, &mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1, NULL); 1); } } return old; return old; } } Loading
services/audioflinger/FastMixer.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -179,7 +179,7 @@ bool FastMixer::threadLoop() ALOG_ASSERT(coldFutexAddr != NULL); ALOG_ASSERT(coldFutexAddr != NULL); int32_t old = android_atomic_dec(coldFutexAddr); int32_t old = android_atomic_dec(coldFutexAddr); if (old <= 0) { if (old <= 0) { __futex_syscall4(coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1, NULL); (void) syscall(__NR_futex, coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1); } } int policy = sched_getscheduler(0); int policy = sched_getscheduler(0); if (!(policy == SCHED_FIFO || policy == SCHED_RR)) { if (!(policy == SCHED_FIFO || policy == SCHED_RR)) { Loading
services/audioflinger/FastMixer.h +2 −3 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,10 @@ #ifndef ANDROID_AUDIO_FAST_MIXER_H #ifndef ANDROID_AUDIO_FAST_MIXER_H #define ANDROID_AUDIO_FAST_MIXER_H #define ANDROID_AUDIO_FAST_MIXER_H #include <linux/futex.h> #include <sys/syscall.h> #include <utils/Debug.h> #include <utils/Debug.h> #include <utils/Thread.h> #include <utils/Thread.h> extern "C" { #include "../private/bionic_futex.h" } #include "StateQueue.h" #include "StateQueue.h" #include "FastMixerState.h" #include "FastMixerState.h" Loading
services/audioflinger/Threads.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -2603,7 +2603,7 @@ AudioFlinger::MixerThread::~MixerThread() if (state->mCommand == FastMixerState::COLD_IDLE) { if (state->mCommand == FastMixerState::COLD_IDLE) { int32_t old = android_atomic_inc(&mFastMixerFutex); int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { if (old == -1) { __futex_syscall4(&mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1, NULL); (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); } } } } state->mCommand = FastMixerState::EXIT; state->mCommand = FastMixerState::EXIT; Loading Loading @@ -2660,7 +2660,7 @@ ssize_t AudioFlinger::MixerThread::threadLoop_write() if (state->mCommand == FastMixerState::COLD_IDLE) { if (state->mCommand == FastMixerState::COLD_IDLE) { int32_t old = android_atomic_inc(&mFastMixerFutex); int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { if (old == -1) { __futex_syscall4(&mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1, NULL); (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); } } #ifdef AUDIO_WATCHDOG #ifdef AUDIO_WATCHDOG if (mAudioWatchdog != 0) { if (mAudioWatchdog != 0) { Loading
services/audioflinger/Tracks.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "Configuration.h" #include "Configuration.h" #include <math.h> #include <math.h> #include <sys/syscall.h> #include <utils/Log.h> #include <utils/Log.h> #include <private/media/AudioTrackShared.h> #include <private/media/AudioTrackShared.h> Loading Loading @@ -952,7 +953,7 @@ void AudioFlinger::PlaybackThread::Track::invalidate() android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_release_store(0x40000000, &cblk->mFutex); android_atomic_release_store(0x40000000, &cblk->mFutex); // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE (void) __futex_syscall4(&cblk->mFutex, FUTEX_WAKE, INT_MAX, NULL); (void) syscall(__NR_futex, &cblk->mFutex, FUTEX_WAKE, INT_MAX); mIsInvalid = true; mIsInvalid = true; } } Loading Loading @@ -1839,7 +1840,7 @@ void AudioFlinger::RecordThread::RecordTrack::invalidate() android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_release_store(0x40000000, &cblk->mFutex); android_atomic_release_store(0x40000000, &cblk->mFutex); // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE (void) __futex_syscall4(&cblk->mFutex, FUTEX_WAKE, INT_MAX, NULL); (void) syscall(__NR_futex, &cblk->mFutex, FUTEX_WAKE, INT_MAX); } } Loading