diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-09-08 06:53:03 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-09-08 06:53:03 +0000 |
commit | 405e05ed84dd62b2c444148ebc59729f36b78b80 (patch) | |
tree | ac54908d9e2b51ab6657331ac7ff40770e008203 /sal/osl | |
parent | bdf8a6a0c37f2c9aa8a8dbb8e8e7399e186164fa (diff) |
INTEGRATION: CWS sb61 (1.6.82); FILE MERGED
2006/08/30 15:24:26 sb 1.6.82.1: #i67191# Fixed spurious wakeup handling in osl_waitCondition.
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/conditn.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sal/osl/unx/conditn.c b/sal/osl/unx/conditn.c index ff4dfe2ec..68cb7a331 100644 --- a/sal/osl/unx/conditn.c +++ b/sal/osl/unx/conditn.c @@ -4,9 +4,9 @@ * * $RCSfile: conditn.c,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2006-02-09 17:06:13 $ + * last change: $Author: vg $ $Date: 2006-09-08 07:53:03 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -245,9 +245,9 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time return osl_cond_result_error; } - if ( ! pCond->m_State ) + if ( pTimeout ) { - if ( pTimeout ) + if ( ! pCond->m_State ) { int ret; struct timeval tp; @@ -290,17 +290,14 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time /* OSL_TRACE("EINTR\n");*/ } } - while ( ret != 0 ); + while ( !pCond->m_State ); } - else + } + else + { + while ( !pCond->m_State ) { - /* spurious wake up prevention */ - do - { - nRet = pthread_cond_wait(&pCond->m_Condition, &pCond->m_Lock); - } - while ( nRet != 0 ); - + nRet = pthread_cond_wait(&pCond->m_Condition, &pCond->m_Lock); if ( nRet != 0 ) { OSL_TRACE("osl_waitCondition : condition wait failed. Errno: %d; %s\n", |