summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadinitialize.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-28 16:15:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-28 16:15:35 +0000
commit5088d978385ce6d28db1731aab57b23ca1f6e9cc (patch)
tree2e061c7ff3c5287ac53f2945421425209cb2c33e /cpukit/score/src/threadinitialize.c
parent2008-02-28 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-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/score/src/threadinitialize.c')
-rw-r--r--cpukit/score/src/threadinitialize.c12
1 files changed, 9 insertions, 3 deletions
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 );