summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-29 09:27:11 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-02 07:46:17 +0200
commit66374dfc0c42066fac5f9a62475029711baac735 (patch)
tree55de652d123c09e0151de57076e7925db77aa76d
parentposix: Remove superfluous thread dispatch disable (diff)
downloadrtems-66374dfc0c42066fac5f9a62475029711baac735.tar.bz2
posix: Avoid Giant lock in _POSIX_signals_Send()
Update #2555. Update #2690.
-rw-r--r--cpukit/posix/src/killinfo.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c
index 3df670c85e..b16b408825 100644
--- a/cpukit/posix/src/killinfo.c
+++ b/cpukit/posix/src/killinfo.c
@@ -76,6 +76,7 @@ int _POSIX_signals_Send(
POSIX_signals_Siginfo_node *psiginfo;
Thread_queue_Heads *heads;
ISR_lock_Context lock_context;
+ Per_CPU_Control *cpu_self;
/*
* Only supported for the "calling process" (i.e. this node).
@@ -120,13 +121,14 @@ int _POSIX_signals_Send(
siginfo->si_value = *value;
}
- _Thread_Disable_dispatch();
+ /* FIXME: https://devel.rtems.org/ticket/2690 */
+ cpu_self = _Thread_Dispatch_disable();
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
- the_thread = _Thread_Executing;
+ the_thread = _Per_CPU_Get_executing( cpu_self );
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
@@ -320,7 +322,7 @@ process_it:
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable( cpu_self );
return 0;
}
@@ -340,7 +342,7 @@ post_process_signal:
_Chain_Get_unprotected( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_POSIX_signals_Release( &lock_context );
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable( cpu_self );
rtems_set_errno_and_return_minus_one( EAGAIN );
}
@@ -354,6 +356,6 @@ post_process_signal:
_POSIX_signals_Release( &lock_context );
DEBUG_STEP("\n");
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable( cpu_self );
return 0;
}