summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/omx/OMX.cpp')
-rw-r--r--media/libstagefright/omx/OMX.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 4e9920b..3638f41 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -86,6 +86,9 @@ OMX::CallbackDispatcher::~CallbackDispatcher() {
mQueueChanged.signal();
}
+ // Don't call join on myself
+ CHECK(mThread != pthread_self());
+
void *dummy;
pthread_join(mThread, &dummy);
}
@@ -246,9 +249,12 @@ status_t OMX::freeNode(node_id node) {
status_t err = instance->freeNode(mMaster);
- index = mDispatchers.indexOfKey(node);
- CHECK(index >= 0);
- mDispatchers.removeItemsAt(index);
+ {
+ Mutex::Autolock autoLock(mLock);
+ index = mDispatchers.indexOfKey(node);
+ CHECK(index >= 0);
+ mDispatchers.removeItemsAt(index);
+ }
return err;
}