diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-02-28 16:15:35 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-02-28 16:15:35 +0000 |
commit | 5088d978385ce6d28db1731aab57b23ca1f6e9cc (patch) | |
tree | 2e061c7ff3c5287ac53f2945421425209cb2c33e /cpukit/rtems/src/taskdelete.c | |
parent | 2008-02-28 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-5088d978385ce6d28db1731aab57b23ca1f6e9cc.tar.bz2 |
2008-02-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* itron/include/rtems/itron/task.h, itron/src/cre_tsk.c,
posix/src/pthreadcreate.c, rtems/src/taskcreate.c,
rtems/src/taskdelete.c, rtems/src/timerserver.c,
score/src/threadclose.c, score/src/threadcreateidle.c,
score/src/threadinitialize.c: Switch task create and delete
operations to using API Allocator Mutex. This moves almost all uses
of the RTEMS Workspace from dispatching disabled to mutex protected
which should improve deterministic behavior. The implementation was
carefully done to allow task create and delete extensions to invoke
more services. In particular, a task delete extension should be able
to do mutex and file operations.
Diffstat (limited to 'cpukit/rtems/src/taskdelete.c')
-rw-r--r-- | cpukit/rtems/src/taskdelete.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c index 890596866b..c7b1edb60c 100644 --- a/cpukit/rtems/src/taskdelete.c +++ b/cpukit/rtems/src/taskdelete.c @@ -31,6 +31,7 @@ #include <rtems/score/wkspace.h> #include <rtems/score/apiext.h> #include <rtems/score/sysstate.h> +#include <rtems/score/apimutex.h> /*PAGE * @@ -58,6 +59,8 @@ rtems_status_code rtems_task_delete( Objects_Locations location; Objects_Information *the_information; + _RTEMS_Lock_allocator(); + the_thread = _Thread_Get( id, &location ); switch ( location ) { @@ -89,11 +92,13 @@ rtems_status_code rtems_task_delete( } #endif + _RTEMS_Unlock_allocator(); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: + _RTEMS_Unlock_allocator(); _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; #endif @@ -102,5 +107,6 @@ rtems_status_code rtems_task_delete( break; } + _RTEMS_Unlock_allocator(); return RTEMS_INVALID_ID; } |