summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-13 15:25:06 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:43 +0200
commitfb7199d3a27036e2de408caef1a8c755dc986050 (patch)
tree5fa4323d16c60aa80a276afeb29131205df69db5
parentscore: Thread life cycle re-implementation (diff)
downloadrtems-fb7199d3a27036e2de408caef1a8c755dc986050.tar.bz2
score: Relax Giant lock usage for API mutexes
It is no longer necessary to protect the workspace allocations with the Giant lock due to the thread life cycle re-implementation.
-rw-r--r--cpukit/posix/src/pthread.c2
-rw-r--r--cpukit/score/src/apimutexlock.c4
-rw-r--r--cpukit/score/src/apimutexunlock.c5
3 files changed, 6 insertions, 5 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 8d1a8eb209..512cd70c8f 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -227,7 +227,7 @@ static bool _POSIX_Threads_Create_extension(
&& _Objects_Get_class( created->Object.id ) == 1
#endif
) {
- executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
+ executing_api = _Thread_Get_executing()->API_Extensions[ THREAD_API_POSIX ];
api->signals_blocked = executing_api->signals_blocked;
} else {
api->signals_blocked = SIGNAL_ALL_MASK;
diff --git a/cpukit/score/src/apimutexlock.c b/cpukit/score/src/apimutexlock.c
index 91f6af3d03..d943bddf5d 100644
--- a/cpukit/score/src/apimutexlock.c
+++ b/cpukit/score/src/apimutexlock.c
@@ -43,4 +43,8 @@ void _API_Mutex_Lock(
0,
level
);
+
+ #if defined(RTEMS_SMP)
+ _Thread_Enable_dispatch();
+ #endif
}
diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c
index 354033c5a4..43bdfe8bbe 100644
--- a/cpukit/score/src/apimutexunlock.c
+++ b/cpukit/score/src/apimutexunlock.c
@@ -27,10 +27,7 @@ void _API_Mutex_Unlock(
API_Mutex_Control *the_mutex
)
{
- /* Dispatch is already disabled in SMP while lock is held. */
- #if !defined(RTEMS_SMP)
- _Thread_Disable_dispatch();
- #endif
+ _Thread_Disable_dispatch();
_CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,