diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-27 14:16:12 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:44 +0200 |
commit | 23fec9f0e18dc4913fab818118f836af150b98f3 (patch) | |
tree | 66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/posix/src/pthreadcreate.c | |
parent | score: Use thread life protection for API mutexes (diff) | |
download | rtems-23fec9f0e18dc4913fab818118f836af150b98f3.tar.bz2 |
score: PR2152: Use allocator mutex for objects
Use allocator mutex for objects allocate/free. This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.
Diffstat (limited to 'cpukit/posix/src/pthreadcreate.c')
-rw-r--r-- | cpukit/posix/src/pthreadcreate.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index 5a6d929959..8d031335cc 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -156,18 +156,13 @@ int pthread_create( #endif /* - * Lock the allocator mutex for protection - */ - _RTEMS_Lock_allocator(); - - /* * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { - _RTEMS_Unlock_allocator(); + _Objects_Allocator_unlock(); return EAGAIN; } @@ -190,7 +185,7 @@ int pthread_create( ); if ( !status ) { _POSIX_Threads_Free( the_thread ); - _RTEMS_Unlock_allocator(); + _Objects_Allocator_unlock(); return EAGAIN; } @@ -235,7 +230,7 @@ int pthread_create( if ( !status ) { _Thread_Enable_dispatch(); _POSIX_Threads_Free( the_thread ); - _RTEMS_Unlock_allocator(); + _Objects_Allocator_unlock(); return EINVAL; } #endif @@ -254,6 +249,6 @@ int pthread_create( */ *thread = the_thread->Object.id; - _RTEMS_Unlock_allocator(); + _Objects_Allocator_unlock(); return 0; } |