summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/keydelete.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/keydelete.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/keydelete.c')
-rw-r--r--cpukit/posix/src/keydelete.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/posix/src/keydelete.c b/cpukit/posix/src/keydelete.c
index cd2b39802d..392558f0f8 100644
--- a/cpukit/posix/src/keydelete.c
+++ b/cpukit/posix/src/keydelete.c
@@ -38,6 +38,7 @@ int pthread_key_delete(
POSIX_Keys_Control *the_key;
Objects_Locations location;
+ _Objects_Allocator_lock();
the_key = _POSIX_Keys_Get( key, &location );
switch ( location ) {
@@ -50,6 +51,7 @@ int pthread_key_delete(
*/
_POSIX_Keys_Free( the_key );
_Objects_Put(&the_key->Object);
+ _Objects_Allocator_unlock();
return 0;
#if defined(RTEMS_MULTIPROCESSING)
@@ -59,5 +61,7 @@ int pthread_key_delete(
break;
}
+ _Objects_Allocator_unlock();
+
return EINVAL;
}