Changeset 8d55b1f in rtems


Ignore:
Timestamp:
Oct 15, 2004, 8:06:35 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
1157fe21
Parents:
27320205
Message:

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

PR 692/rtems

  • src/regiongetsegment.c, 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.
Location:
cpukit/rtems
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/ChangeLog

    r27320205 r8d55b1f  
     12004-10-15      Joel Sherrill <joel@OARcorp.com>
     2
     3        PR 692/rtems
     4        * src/regiongetsegment.c, src/regionreturnsegment.c: The Region Manager
     5        did not follow the proper protocol when blocking and unblocking tasks
     6        waiting on buffers. This was a bug introduced with the transition to
     7        an Allocation Mutex.
     8
    192004-07-24      Mick Davis <mickd@microsol.iinet.net.au>
    210
  • cpukit/rtems/src/regiongetsegment.c

    r27320205 r8d55b1f  
    9999      }
    100100
     101      /*
     102       *  Switch from using the memory allocation mutex to using a
     103       *  dispatching disabled critical section.  We have to do this
     104       *  because this thread is going to block.
     105       */
     106      _Thread_Disable_dispatch();
     107      _RTEMS_Unlock_allocator();
     108
    101109      executing->Wait.queue           = &the_region->Wait_queue;
    102110      executing->Wait.id              = id;
     
    108116      _Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
    109117
    110       _RTEMS_Unlock_allocator();
     118      _Thread_Enable_dispatch();
     119
    111120      return (rtems_status_code) executing->Wait.return_code;
    112121  }
  • cpukit/rtems/src/regionreturnsegment.c

    r27320205 r8d55b1f  
    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.