summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadcreate.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-27 14:16:12 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:44 +0200
commit23fec9f0e18dc4913fab818118f836af150b98f3 (patch)
tree66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/posix/src/pthreadcreate.c
parentscore: Use thread life protection for API mutexes (diff)
downloadrtems-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.c13
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;
}