diff options
author | phintuka <phintuka> | 2006-08-19 23:44:07 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2006-08-19 23:44:07 +0000 |
commit | 0ee8fe804beb594de2b1777fcd9ea7bf4d591f8f (patch) | |
tree | 31c4bae74cecda8de6987ba448b84cae546f9425 /tools/future.h | |
parent | 26a52607f47bbb1f20ddcd5d6eaccb6159baa95f (diff) | |
download | xineliboutput-0ee8fe804beb594de2b1777fcd9ea7bf4d591f8f.tar.gz xineliboutput-0ee8fe804beb594de2b1777fcd9ea7bf4d591f8f.tar.bz2 |
Fix wait if data is already there
Diffstat (limited to 'tools/future.h')
-rw-r--r-- | tools/future.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/future.h b/tools/future.h index 73d4bfec..bdd0498c 100644 --- a/tools/future.h +++ b/tools/future.h @@ -5,7 +5,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: future.h,v 1.1 2006-06-03 10:04:27 phintuka Exp $ + * $Id: future.h,v 1.2 2006-08-19 23:44:07 phintuka Exp $ * */ @@ -56,13 +56,16 @@ class cFuture { { cMutexLock l(&mutex); + if(Timeout==0 || m_Ready) + return m_Ready; + if(Timeout >= 0) - return cond.TimedWait(mutex, Timeout); + return cond.TimedWait(mutex, Timeout) && m_Ready; while(!m_Ready) cond.Wait(mutex); - return true; + return m_Ready; } bool IsReady(void) |