Ignore:
Timestamp:
Oct 15, 2004, 9:05:07 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
be216b3
Parents:
ba1a188c
Message:

2004-10-15 Joel Sherrill <joel@…>

PR 692/rtems

  • rtems/src/regiongetsegment.c, rtems/src/regionreturnsegment.c: The Region Manager did not follow the proper protocol when blocking and unblocking tasks waiting on buffers. This was a bug introduced with the transition to an Allocation Mutex.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/regionreturnsegment.c

    rba1a188c r626ace4  
    9595
    9696      the_region->number_of_used_blocks -= 1;
     97
     98      /*
     99       *  Switch from using the memory allocation mutex to using a
     100       *  dispatching disabled critical section.  We have to do this
     101       *  because this thread may unblock one or more threads that were
     102       *  waiting on memory.
     103       *
     104       *  NOTE: The following loop is O(n) where n is the number of
     105       *        threads whose memory request is satisfied.
     106       */
     107      _RTEMS_Unlock_allocator();
     108      _Thread_Disable_dispatch();
     109
    97110      for ( ; ; ) {
    98111        the_thread = _Thread_queue_First( &the_region->Wait_queue );
     
    114127        the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
    115128      }
     129      _Thread_Enable_dispatch();
    116130
    117       _RTEMS_Unlock_allocator();
    118131      return RTEMS_SUCCESSFUL;
    119132  }
Note: See TracChangeset for help on using the changeset viewer.