Changeset c838e2f4 in rtems


Ignore:
Timestamp:
Jul 28, 2010, 8:39:48 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
57c841e9
Parents:
ec6a5a1
Message:

2010-07-28 Vinu Rajashekhar <vinutheraj@…>

  • posix/src/condinit.c, posix/src/condwaitsupp.c, posix/src/psignalunblockthread.c: Clean up some signal interruption code.
Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rec6a5a1 rc838e2f4  
     12010-07-28      Vinu Rajashekhar <vinutheraj@gmail.com>
     2
     3        * posix/src/condinit.c, posix/src/condwaitsupp.c,
     4        posix/src/psignalunblockthread.c: Clean up some signal interruption
     5        code.
     6
    172010-07-27      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • cpukit/posix/src/condinit.c

    rec6a5a1 rc838e2f4  
    4545   *  Be careful about attributes when global!!!
    4646   */
    47 
    4847  if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
    4948    return EINVAL;
     
    6564  the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
    6665
    67 /* XXX some more initialization might need to go here */
    6866  _Thread_queue_Initialize(
    6967    &the_cond->Wait_queue,
    7068    THREAD_QUEUE_DISCIPLINE_FIFO,
    71     STATES_WAITING_FOR_CONDITION_VARIABLE,
     69    STATES_WAITING_FOR_CONDITION_VARIABLE | STATES_INTERRUPTIBLE_BY_SIGNAL,
    7270    ETIMEDOUT
    7371  );
  • cpukit/posix/src/condwaitsupp.c

    rec6a5a1 rc838e2f4  
    8686         */
    8787
     88        /*
     89         *  If the thread is interrupted, while in the thread queue, by
     90         *  a POSIX signal, then pthread_cond_wait returns spuriously,
     91         *  according to the POSIX standard. It means that pthread_cond_wait
     92         *  returns a success status, except for the fact that it was not
     93         *  woken up a pthread_cond_signal or a pthread_cond_broadcast.
     94         */
    8895        status = _Thread_Executing->Wait.return_code;
    89         if ( status && status != ETIMEDOUT )
    90           return status;
     96        if ( status == EINTR )
     97          status = 0;
    9198
    9299      } else {
  • cpukit/posix/src/psignalunblockthread.c

    rec6a5a1 rc838e2f4  
    102102      the_thread->Wait.return_code = EINTR;
    103103      /*
    104        *  At this time, there is no RTEMS API object which lets a task
    105        *  block on a thread queue and be interruptible by a POSIX signal.
    106        *  If an object class with that requirement is ever added, enable
    107        *  this code.
     104       *  In pthread_cond_wait, a thread will be blocking on a thread
     105       *  queue, but is also interruptible by a POSIX signal.
    108106       */
    109       #if 0
    110107        if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
    111108          _Thread_queue_Extract_with_proxy( the_thread );
    112         else
    113       #endif
    114           if ( _States_Is_delaying(the_thread->current_state) ){
     109        else if ( _States_Is_delaying(the_thread->current_state) ){
    115110            if ( _Watchdog_Is_active( &the_thread->Timer ) )
    116111              (void) _Watchdog_Remove( &the_thread->Timer );
    117112            _Thread_Unblock( the_thread );
    118113          }
     114
    119115    } else if ( the_thread->current_state == STATES_READY ) {
    120116      if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
Note: See TracChangeset for help on using the changeset viewer.