repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
959712c
)
platform: fixed return value from CCondition::Wait()
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Fri, 17 Feb 2012 01:58:48 +0000
(
02:58
+0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Fri, 17 Feb 2012 10:39:30 +0000
(11:39 +0100)
src/lib/platform/threads/mutex.h
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/platform/threads/mutex.h
b/src/lib/platform/threads/mutex.h
index 5a9ae135ee9858548c937b2faf395224fa44d7bb..6bd126e4c7452b1658e285386e5dd0f106917700 100644
(file)
--- a/
src/lib/platform/threads/mutex.h
+++ b/
src/lib/platform/threads/mutex.h
@@
-257,18
+257,19
@@
namespace PLATFORM
if (iTimeout == 0)
return Wait(mutex, predicate);
if (iTimeout == 0)
return Wait(mutex, predicate);
- bool bReturn(true);
- if (!predicate)
+ if (predicate)
+ return true;
+
+ bool bReturn(false);
+ bool bBreak(false);
+ CTimeout timeout(iTimeout);
+ uint32_t iMsLeft(0);
+
+ while (!bReturn && !bBreak)
{
{
- CTimeout timeout(iTimeout);
- uint32_t iMsLeft(0);
- bReturn = false;
- while (!bReturn)
- {
- iMsLeft = timeout.TimeLeft();
- if ((bReturn = iMsLeft == 0 || predicate) == false)
- m_condition.Wait(mutex.m_mutex, iMsLeft);
- }
+ iMsLeft = timeout.TimeLeft();
+ if ((bReturn = predicate) == false && (bBreak = iMsLeft == 0) == false)
+ m_condition.Wait(mutex.m_mutex, iMsLeft);
}
return bReturn;
}
}
return bReturn;
}