diff options
author | Glenn Kasten <gkasten@google.com> | 2013-09-20 22:38:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-20 22:38:19 +0000 |
commit | 543de8746e1c238f81a863f687d258ad86f5ef95 (patch) | |
tree | 78a2b67871f5c01e2c98d72810c3042de11f2bd3 /core/jni | |
parent | 04476691424811f5029194410519f49f913b672d (diff) | |
parent | f69cd6787d39188ea7bc41fe7d54314fb18eb214 (diff) | |
download | frameworks_base-543de8746e1c238f81a863f687d258ad86f5ef95.zip frameworks_base-543de8746e1c238f81a863f687d258ad86f5ef95.tar.gz frameworks_base-543de8746e1c238f81a863f687d258ad86f5ef95.tar.bz2 |
Merge "Revert "Workaround for slow AudioRecord destructor"" into klp-dev
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_media_AudioRecord.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp index 3994047..1c43cc5 100644 --- a/core/jni/android_media_AudioRecord.cpp +++ b/core/jni/android_media_AudioRecord.cpp @@ -310,18 +310,6 @@ android_media_AudioRecord_stop(JNIEnv *env, jobject thiz) // ---------------------------------------------------------------------------- -// This class is used to destroy a RefBase asynchronously -class AsyncDestructThread : public Thread -{ -public: - AsyncDestructThread(sp<RefBase> refBase) : mRefBase(refBase) { } -protected: - virtual ~AsyncDestructThread() { } -private: - virtual bool threadLoop() { return false; } - const sp<RefBase> mRefBase; -}; - #define CALLBACK_COND_WAIT_TIMEOUT_MS 1000 static void android_media_AudioRecord_release(JNIEnv *env, jobject thiz) { sp<AudioRecord> lpRecorder = setAudioRecord(env, thiz, 0); @@ -354,17 +342,6 @@ static void android_media_AudioRecord_release(JNIEnv *env, jobject thiz) { env->DeleteGlobalRef(lpCookie->audioRecord_ref); delete lpCookie; } - // FIXME AudioRecord destruction should not be slow - if (lpRecorder != 0) { - // must be a raw reference to avoid a race after run() - AsyncDestructThread *adt = new AsyncDestructThread(lpRecorder); - // guaranteed to not run destructor - lpRecorder.clear(); - // after the run(), adt thread will hold a strong reference to lpRecorder, - // and the only strong reference to itself - adt->run("AsyncDestruct"); - // do not delete adt here: adt thread destroys itself, and lpRecorder if needed - } } |