From 5088d978385ce6d28db1731aab57b23ca1f6e9cc Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 28 Feb 2008 16:15:35 +0000 Subject: 2008-02-28 Joel Sherrill * 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. --- cpukit/score/src/threadinitialize.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cpukit/score/src/threadinitialize.c') diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index b2e09727cc..7ef9125a46 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -2,7 +2,7 @@ * Thread Handler * * - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -61,6 +61,7 @@ boolean _Thread_Initialize( void *fp_area; #endif void *extensions_area; + boolean extension_status; /* * Initialize the Ada self pointer @@ -220,10 +221,15 @@ boolean _Thread_Initialize( _Objects_Open( information, &the_thread->Object, name ); /* - * Invoke create extensions + * We assume the Allocator Mutex is locked and dispatching is + * enabled when we get here. We want to be able to run the + * user extensions with dispatching enabled. The Allocator + * Mutex provides sufficient protection to let the user extensions + * run safely. */ + extension_status = _User_extensions_Thread_create( the_thread ); - if ( !_User_extensions_Thread_create( the_thread ) ) { + if ( !extension_status ) { if ( extensions_area ) (void) _Workspace_Free( extensions_area ); -- cgit v1.2.3