axeld + bonefish:

Changed condition variables so that it is allowed to block (e.g. lock
mutexes etc.) between Add() and Wait(). This fixes #2059, since the
block writer used them this way and could thusly fail to wait for a
condition variable, causing a temporary stack object to be used past its
lifetime.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25525 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-05-17 10:21:37 +00:00
parent a93840a2f4
commit fbe0c27a94
5 changed files with 43 additions and 22 deletions
+3 -3
View File
@@ -27,9 +27,8 @@ public:
inline ~ConditionVariableEntry();
#endif
bool Add(const void* object, uint32 flags = 0);
status_t Wait(uint32 timeoutFlags = 0,
bigtime_t timeout = 0);
bool Add(const void* object);
status_t Wait(uint32 flags = 0, bigtime_t timeout = 0);
status_t Wait(const void* object, uint32 flags = 0,
bigtime_t timeout = 0);
@@ -42,6 +41,7 @@ private:
private:
ConditionVariable* fVariable;
struct thread* fThread;
status_t fWaitStatus;
friend class ConditionVariable;
};