From 93306058c0417b1c6e950b44ef279e096062dfba Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 27 May 2016 14:43:19 +0200 Subject: score: _CORE_mutex_Check_dispatch_for_seize() Move the safety check performed by _CORE_mutex_Check_dispatch_for_seize() out of the performance critical path and generalize it. Blocking on a thread queue with an unexpected thread dispatch disabled level is illegal in all system states. Add the expected thread dispatch disable level (which may be 1 or 2 depending on the operation) to Thread_queue_Context and use it in _Thread_queue_Enqueue_critical(). --- cpukit/posix/src/killinfo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cpukit/posix/src/killinfo.c') diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c index b16b408825..33754af682 100644 --- a/cpukit/posix/src/killinfo.c +++ b/cpukit/posix/src/killinfo.c @@ -75,7 +75,7 @@ int _POSIX_signals_Send( siginfo_t *siginfo; POSIX_signals_Siginfo_node *psiginfo; Thread_queue_Heads *heads; - ISR_lock_Context lock_context; + Thread_queue_Context queue_context; Per_CPU_Control *cpu_self; /* @@ -334,14 +334,15 @@ post_process_signal: */ _POSIX_signals_Set_process_signals( mask ); - _POSIX_signals_Acquire( &lock_context ); + _Thread_queue_Context_initialize( &queue_context ); + _POSIX_signals_Acquire( &queue_context ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get_unprotected( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { - _POSIX_signals_Release( &lock_context ); + _POSIX_signals_Release( &queue_context ); _Thread_Dispatch_enable( cpu_self ); rtems_set_errno_and_return_minus_one( EAGAIN ); } @@ -354,7 +355,7 @@ post_process_signal: ); } - _POSIX_signals_Release( &lock_context ); + _POSIX_signals_Release( &queue_context ); DEBUG_STEP("\n"); _Thread_Dispatch_enable( cpu_self ); return 0; -- cgit v1.2.3