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(). --- testsuites/sptests/spfatal03/testcase.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/spfatal03/testcase.h b/testsuites/sptests/spfatal03/testcase.h index 86b300344e..34a20f6825 100644 --- a/testsuites/sptests/spfatal03/testcase.h +++ b/testsuites/sptests/spfatal03/testcase.h @@ -16,7 +16,7 @@ #define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE #define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE #define FATAL_ERROR_EXPECTED_ERROR \ - INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE + INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_FROM_BAD_STATE void force_error(void) { @@ -26,7 +26,7 @@ void force_error(void) status = rtems_semaphore_create( rtems_build_name( 'S','0',' ',' '), - 1, + 0, RTEMS_LOCAL| RTEMS_SIMPLE_BINARY_SEMAPHORE, 0, @@ -37,7 +37,7 @@ void force_error(void) printk("Obtain semaphore in dispatching critical section\n"); _Thread_Dispatch_disable(); - status = rtems_semaphore_obtain( mutex, RTEMS_DEFAULT_OPTIONS, 0 ); + status = rtems_semaphore_obtain( mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); /* !!! SHOULD NOT RETURN FROM THE ABOVE CALL */ rtems_test_assert( 0 ); -- cgit v1.2.3