diff options
author | Sundar Raman <sunds@ti.com> | 2011-11-10 08:15:13 -0800 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-11-10 13:49:03 -0800 |
commit | f9df3ee5cfb3c3177bcc630abf6d756e8a60254c (patch) | |
tree | e54483e9f121255bb3d4562e82b2ab2b40bd8f8d /libtiutils | |
parent | 3ec18006399d61e97382601d14aaa43ee339c8b6 (diff) | |
download | hardware_ti_omap4xxx-f9df3ee5cfb3c3177bcc630abf6d756e8a60254c.zip hardware_ti_omap4xxx-f9df3ee5cfb3c3177bcc630abf6d756e8a60254c.tar.gz hardware_ti_omap4xxx-f9df3ee5cfb3c3177bcc630abf6d756e8a60254c.tar.bz2 |
CameraHAL: Clear events queue fix, clear command queue on exit
Fix 2/3 for b/5593964.
1. The events queue wasn't being cleared correctly inside
OMXCameraAdapter as some items were being removed while the
index was being formulated based on the original size
2. The command queue should be cleared before posting the EXIT
message for the OMX adapter threads so as not to process those
messages since we are exiting
Change-Id: I0a5eaceb3d1504fee05b064ebb5fe888e129ad44
Signed-off-by: Sundar Raman <sunds@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'libtiutils')
-rwxr-xr-x | libtiutils/MessageQueue.cpp | 18 | ||||
-rwxr-xr-x | libtiutils/MessageQueue.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/libtiutils/MessageQueue.cpp b/libtiutils/MessageQueue.cpp index 28bb0e3..11f5407 100755 --- a/libtiutils/MessageQueue.cpp +++ b/libtiutils/MessageQueue.cpp @@ -276,6 +276,24 @@ bool MessageQueue::isEmpty() return !mHasMsg; } +void MessageQueue::clear() +{ + if(!this->fd_read) + { + MSGQ_LOGEA("read descriptor not initialized for message queue"); + LOG_FUNCTION_NAME_EXIT; + return; + } + + Message msg; + while(!isEmpty()) + { + get(&msg); + } + +} + + /** @brief Force whether the message queue has message or not diff --git a/libtiutils/MessageQueue.h b/libtiutils/MessageQueue.h index 97e11a7..6d05201 100755 --- a/libtiutils/MessageQueue.h +++ b/libtiutils/MessageQueue.h @@ -83,6 +83,8 @@ public: ///Returns if the message queue is empty or not bool isEmpty(); + void clear(); + ///Force whether the message queue has message or not void setMsg(bool hasMsg=false); |