summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pspindestroy.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/pspindestroy.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/pspindestroy.c')
-rw-r--r--cpukit/posix/src/pspindestroy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/posix/src/pspindestroy.c b/cpukit/posix/src/pspindestroy.c
index 7795a33764..ab45ad1e92 100644
--- a/cpukit/posix/src/pspindestroy.c
+++ b/cpukit/posix/src/pspindestroy.c
@@ -45,6 +45,7 @@ int pthread_spin_destroy(
if ( !spinlock )
return EINVAL;
+ _Objects_Allocator_lock();
the_spinlock = _POSIX_Spinlock_Get( spinlock, &location );
switch ( location ) {
@@ -55,10 +56,10 @@ int pthread_spin_destroy(
}
_Objects_Close( &_POSIX_Spinlock_Information, &the_spinlock->Object );
-
+ _Objects_Put( &the_spinlock->Object );
_POSIX_Spinlock_Free( the_spinlock );
+ _Objects_Allocator_unlock();
- _Objects_Put( &the_spinlock->Object );
return 0;
#if defined(RTEMS_MULTIPROCESSING)
@@ -68,5 +69,7 @@ int pthread_spin_destroy(
break;
}
+ _Objects_Allocator_unlock();
+
return EINVAL;
}