diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-07 15:55:55 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-07 16:48:02 +0200 |
commit | b2700c35019cff23103bdd394d3d6c52fe00365e (patch) | |
tree | 237506c3647ef5e0875a669d4d8b1201a0df6732 | |
parent | tmtests/tm21: Fix configuration (diff) | |
download | rtems-b2700c35019cff23103bdd394d3d6c52fe00365e.tar.bz2 |
score: Use proper protection
-rw-r--r-- | cpukit/rtems/src/workspacegreedy.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cpukit/rtems/src/workspacegreedy.c b/cpukit/rtems/src/workspacegreedy.c index ad46df2561..ecd4b86577 100644 --- a/cpukit/rtems/src/workspacegreedy.c +++ b/cpukit/rtems/src/workspacegreedy.c @@ -24,6 +24,7 @@ #endif #include <rtems/rtems/support.h> +#include <rtems/score/apimutex.h> #include <rtems/score/heapimpl.h> #include <rtems/score/threaddispatch.h> #include <rtems/score/wkspace.h> @@ -35,9 +36,9 @@ void *rtems_workspace_greedy_allocate( { void *opaque; - _Thread_Disable_dispatch(); + _RTEMS_Lock_allocator(); opaque = _Heap_Greedy_allocate( &_Workspace_Area, block_sizes, block_count ); - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return opaque; } @@ -48,19 +49,19 @@ void *rtems_workspace_greedy_allocate_all_except_largest( { void *opaque; - _Thread_Disable_dispatch(); + _RTEMS_Lock_allocator(); opaque = _Heap_Greedy_allocate_all_except_largest( &_Workspace_Area, allocatable_size ); - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return opaque; } void rtems_workspace_greedy_free( void *opaque ) { - _Thread_Disable_dispatch(); + _RTEMS_Lock_allocator(); _Heap_Greedy_free( &_Workspace_Area, opaque ); - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); } |