summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/regiongetsegment.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2004-10-15 21:05:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2004-10-15 21:05:07 +0000
commit626ace47dfdfd510ee8363381a97339f99303959 (patch)
tree20ef46bf72c4e67a8ba0c7b59254feb995ed35bc /cpukit/rtems/src/regiongetsegment.c
parent2004-10-15 Gene Smith <gene.smith@seimens.com> (diff)
downloadrtems-626ace47dfdfd510ee8363381a97339f99303959.tar.bz2
2004-10-15 Joel Sherrill <joel@OARcorp.com>
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.
Diffstat (limited to 'cpukit/rtems/src/regiongetsegment.c')
-rw-r--r--cpukit/rtems/src/regiongetsegment.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpukit/rtems/src/regiongetsegment.c b/cpukit/rtems/src/regiongetsegment.c
index 27d6bf66dd..dc58a27ff3 100644
--- a/cpukit/rtems/src/regiongetsegment.c
+++ b/cpukit/rtems/src/regiongetsegment.c
@@ -98,6 +98,14 @@ rtems_status_code rtems_region_get_segment(
return RTEMS_UNSATISFIED;
}
+ /*
+ * Switch from using the memory allocation mutex to using a
+ * dispatching disabled critical section. We have to do this
+ * because this thread is going to block.
+ */
+ _Thread_Disable_dispatch();
+ _RTEMS_Unlock_allocator();
+
executing->Wait.queue = &the_region->Wait_queue;
executing->Wait.id = id;
executing->Wait.count = size;
@@ -107,7 +115,8 @@ rtems_status_code rtems_region_get_segment(
_Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
- _RTEMS_Unlock_allocator();
+ _Thread_Enable_dispatch();
+
return (rtems_status_code) executing->Wait.return_code;
}