Changeset 1d56a7a in rtems


Ignore:
Timestamp:
Nov 27, 2007, 6:38:18 PM (12 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.10, 4.11, 4.9, master
Children:
0da244d
Parents:
5700b804
Message:

2007-11-27 Glenn Humphrey <glenn.humphrey@…>

  • posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c, rtems/include/rtems/rtems/barrier.h, score/src/corerwlockobtainread.c, score/src/corerwlockobtainwrite.c, score/src/corerwlockrelease.c: Fixed several implementation errors.
Location:
cpukit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r5700b804 r1d56a7a  
     12007-11-27      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c,
     4        rtems/include/rtems/rtems/barrier.h,
     5        score/src/corerwlockobtainread.c, score/src/corerwlockobtainwrite.c,
     6        score/src/corerwlockrelease.c: Fixed several implementation errors.
     7
    182007-11-27      Glenn Humphrey <glenn.humphrey@OARcorp.com>
    29
  • cpukit/posix/src/prwlocktimedrdlock.c

    r5700b804 r1d56a7a  
    5050
    5151  status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
    52   if ( !status )
     52  if ( status )
    5353    return status;
    5454
  • cpukit/posix/src/prwlocktimedwrlock.c

    r5700b804 r1d56a7a  
    5050
    5151  status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
    52   if ( !status )
     52  if ( status )
    5353    return status;
    5454
  • cpukit/rtems/include/rtems/rtems/barrier.h

    r5700b804 r1d56a7a  
    146146 *
    147147 *  @param[in] id indicates the barrier to wait at.
    148  *  @param[in] option_set indicates if the caller is willing to wait.
    149148 *  @param[in] timeout is the maximum length of time in ticks the calling
    150149 *             thread is willing to block.
     
    162161 *  This routine implements the rtems_barrier_release directive.  It
    163162 *  unblocks all of the threads waiting on the barrier associated with
    164  *  @a id.  The number of threads unblocked is returns in @a unblocked.
     163 *  @a id.  The number of threads unblocked is returned in @a released.
    165164 *
    166165 *
    167166 *  @param[in] id indicates the barrier to wait at.
    168  *  @param[out] unblocked will contain the number of threads unblocked.
     167 *  @param[out] released will contain the number of threads unblocked.
    169168 *
    170169 *  @return a status code indicating success or the reason for failure.
     
    172171rtems_status_code rtems_barrier_release(
    173172  rtems_id  id,
    174   uint32_t *unblocked
     173  uint32_t *released
    175174);
    176175
  • cpukit/score/src/corerwlockobtainread.c

    r5700b804 r1d56a7a  
    8585      _ISR_Enable( level );
    8686      executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
     87      return;
    8788    }
    8889
  • cpukit/score/src/corerwlockobtainwrite.c

    r5700b804 r1d56a7a  
    7575      _ISR_Enable( level );
    7676      executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
     77      return;
    7778    }
    7879
  • cpukit/score/src/corerwlockrelease.c

    r5700b804 r1d56a7a  
    4141  Thread_Control *executing = _Thread_Executing;
    4242  Thread_Control *next;
    43   uint32_t        rwmode;
    4443
    4544  /*
     
    8180   
    8281    if ( next ) {
    83       rwmode = next->Wait.option;
    84       if ( rwmode == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
    85        the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
    86        return CORE_RWLOCK_SUCCESSFUL;
    87      }
     82      if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
     83        the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
     84        return CORE_RWLOCK_SUCCESSFUL;
     85      }
    8886
    89      /*
    90       * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING now see if more
    91       * readers can be let go.
    92       */
     87      /*
     88       * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
     89       */
     90      the_rwlock->number_of_readers += 1;
     91      the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
    9392
    94      while ( 1 ) {
    95        next = _Thread_queue_First( &the_rwlock->Wait_queue );
    96        if ( !next )
    97          return CORE_RWLOCK_SUCCESSFUL;
    98        if ( next->Wait.option != CORE_RWLOCK_THREAD_WAITING_FOR_READ )
    99          return CORE_RWLOCK_SUCCESSFUL;
    100 
    101        /* it is definitely wanting to read */
    102        the_rwlock->number_of_readers += 1;
    103        _Thread_queue_Extract( &the_rwlock->Wait_queue, next );
    104      }
    105 
    106     /* XXX need to put read/write lock request indicator in Wait info */
    107 
    108   }
     93      /*
     94       * Now see if more readers can be let go.
     95       */
     96      while ( 1 ) {
     97        next = _Thread_queue_First( &the_rwlock->Wait_queue );
     98        if ( !next || 
     99             next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
     100          return CORE_RWLOCK_SUCCESSFUL;
     101        the_rwlock->number_of_readers += 1;
     102        _Thread_queue_Extract( &the_rwlock->Wait_queue, next );
     103      }
     104    }
     105  /* indentation is to match _ISR_Disable at top */
    109106
    110107  return CORE_RWLOCK_SUCCESSFUL;
Note: See TracChangeset for help on using the changeset viewer.