summaryrefslogtreecommitdiffstats
path: root/libtiutils
diff options
context:
space:
mode:
authorAkwasi Boateng <akwasi.boateng@ti.com>2011-09-08 20:35:42 -0500
committerIliyan Malchev <malchev@google.com>2011-09-09 13:31:08 -0700
commit828bb460bc8b99a027f3e789defd5aaf98800fcc (patch)
tree29968aef143567ce8010b6f9eac48b5dbef48692 /libtiutils
parent92b2dc62333f907c86f4b344d5a074a70d53a75e (diff)
downloadhardware_ti_omap4-828bb460bc8b99a027f3e789defd5aaf98800fcc.zip
hardware_ti_omap4-828bb460bc8b99a027f3e789defd5aaf98800fcc.tar.gz
hardware_ti_omap4-828bb460bc8b99a027f3e789defd5aaf98800fcc.tar.bz2
Destroy and recreate semaphore in case of timeout
Destroy and recreate semaphor during timeout and remove event from event queue. Change-Id: Id9428ff58a55f90a6807776327bfba1961d9089d Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
Diffstat (limited to 'libtiutils')
-rw-r--r--libtiutils/Semaphore.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libtiutils/Semaphore.cpp b/libtiutils/Semaphore.cpp
index 1f46dca..41fa99c 100644
--- a/libtiutils/Semaphore.cpp
+++ b/libtiutils/Semaphore.cpp
@@ -217,6 +217,12 @@ status_t Semaphore::WaitTimeout(int timeoutMicroSecs)
ret = sem_timedwait(mSemaphore, &timeSpec);
}
+ if ( NO_ERROR != ret )
+ {
+ Signal();
+ Create(0);
+ }
+
return ret;
}