diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-28 20:39:48 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-28 20:39:48 +0000 |
commit | c838e2f437e92d76173d86402c74b73e847af88a (patch) | |
tree | 9f809fc793b19e2eeca2a856e96a2ac7e36a425b /cpukit/posix/src/condwaitsupp.c | |
parent | 2010-07-27 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-c838e2f437e92d76173d86402c74b73e847af88a.tar.bz2 |
2010-07-28 Vinu Rajashekhar <vinutheraj@gmail.com>
* posix/src/condinit.c, posix/src/condwaitsupp.c,
posix/src/psignalunblockthread.c: Clean up some signal interruption
code.
Diffstat (limited to 'cpukit/posix/src/condwaitsupp.c')
-rw-r--r-- | cpukit/posix/src/condwaitsupp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c index f08c7d0649..745d224d3d 100644 --- a/cpukit/posix/src/condwaitsupp.c +++ b/cpukit/posix/src/condwaitsupp.c @@ -85,9 +85,16 @@ int _POSIX_Condition_variables_Wait_support( * _Thread_queue_Enqueue. */ + /* + * If the thread is interrupted, while in the thread queue, by + * a POSIX signal, then pthread_cond_wait returns spuriously, + * according to the POSIX standard. It means that pthread_cond_wait + * returns a success status, except for the fact that it was not + * woken up a pthread_cond_signal or a pthread_cond_broadcast. + */ status = _Thread_Executing->Wait.return_code; - if ( status && status != ETIMEDOUT ) - return status; + if ( status == EINTR ) + status = 0; } else { _Thread_Enable_dispatch(); |