diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-08 06:28:04 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-12 07:36:18 +0200 |
commit | 0158a60cdc8c9251f6c7e42d0b4112d8c11a9d73 (patch) | |
tree | c2fa40672274618181386548d337096f199cf826 | |
parent | d26b053d025dd754e48411057d818a7641de7a3b (diff) |
rtems: Ensure lock ownership for _Region_Get()
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/regionimpl.h | 3 | ||||
-rw-r--r-- | cpukit/rtems/src/regiondelete.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/regionimpl.h b/cpukit/rtems/include/rtems/rtems/regionimpl.h index 724a1c1a6e..4598351a20 100644 --- a/cpukit/rtems/include/rtems/rtems/regionimpl.h +++ b/cpukit/rtems/include/rtems/rtems/regionimpl.h @@ -18,6 +18,8 @@ #define _RTEMS_RTEMS_REGIONIMPL_H #include <rtems/rtems/region.h> +#include <rtems/score/apimutex.h> +#include <rtems/score/assert.h> #include <rtems/score/heapimpl.h> #include <rtems/score/objectimpl.h> #include <rtems/score/threadqimpl.h> @@ -79,6 +81,7 @@ RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Locations *location ) { + _Assert( _RTEMS_Allocator_is_owner() ); return (Region_Control *) _Objects_Get_no_protection( &_Region_Information, id, location ); } diff --git a/cpukit/rtems/src/regiondelete.c b/cpukit/rtems/src/regiondelete.c index bf6e46128a..f25642354b 100644 --- a/cpukit/rtems/src/regiondelete.c +++ b/cpukit/rtems/src/regiondelete.c @@ -35,6 +35,7 @@ rtems_status_code rtems_region_delete( Region_Control *the_region; _Objects_Allocator_lock(); + _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { @@ -59,6 +60,7 @@ rtems_status_code rtems_region_delete( break; } + _RTEMS_Unlock_allocator(); _Objects_Allocator_unlock(); return return_status; |