diff options
Diffstat (limited to 'c/src/exec/rtems/src/regiongetsegmentsize.c')
-rw-r--r-- | c/src/exec/rtems/src/regiongetsegmentsize.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/c/src/exec/rtems/src/regiongetsegmentsize.c b/c/src/exec/rtems/src/regiongetsegmentsize.c index 63d8c96b1c..abdf755173 100644 --- a/c/src/exec/rtems/src/regiongetsegmentsize.c +++ b/c/src/exec/rtems/src/regiongetsegmentsize.c @@ -20,6 +20,7 @@ #include <rtems/rtems/region.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> +#include <rtems/score/apimutex.h> /*PAGE * @@ -48,22 +49,25 @@ rtems_status_code rtems_region_get_segment_size( Objects_Locations location; Thread_Control *executing; + _RTEMS_Lock_allocator(); executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_REMOTE: /* this error cannot be returned */ + _RTEMS_Unlock_allocator(); return RTEMS_INTERNAL_ERROR; case OBJECTS_ERROR: + _RTEMS_Unlock_allocator(); return RTEMS_INVALID_ID; case OBJECTS_LOCAL: if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) { - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return RTEMS_INVALID_ADDRESS; } |