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/taskcreate.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/taskcreate.c')
-rw-r--r-- | cpukit/rtems/src/taskcreate.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpukit/rtems/src/taskcreate.c b/cpukit/rtems/src/taskcreate.c index 99e6628c92..38d924ad39 100644 --- a/cpukit/rtems/src/taskcreate.c +++ b/cpukit/rtems/src/taskcreate.c @@ -2,7 +2,7 @@ * RTEMS Task Manager * * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -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 * @@ -133,10 +134,9 @@ rtems_status_code rtems_task_create( */ /* - * Disable dispatch for protection + * Lock the allocator mutex for protection */ - - _Thread_Disable_dispatch(); + _RTEMS_Lock_allocator(); /* * Allocate the thread control block and -- if the task is global -- @@ -151,7 +151,7 @@ rtems_status_code rtems_task_create( the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return RTEMS_TOO_MANY; } @@ -161,7 +161,7 @@ rtems_status_code rtems_task_create( if ( _Objects_MP_Is_null_global_object( the_global_object ) ) { _RTEMS_tasks_Free( the_thread ); - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return RTEMS_TOO_MANY; } } @@ -193,7 +193,7 @@ rtems_status_code rtems_task_create( _Objects_MP_Free_global_object( the_global_object ); #endif _RTEMS_tasks_Free( the_thread ); - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return RTEMS_UNSATISFIED; } @@ -224,6 +224,6 @@ rtems_status_code rtems_task_create( } #endif - _Thread_Enable_dispatch(); + _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } |