From f009ed086d3da813a2c92b9834c3b2d618894883 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 27 Apr 2016 16:36:04 +0200 Subject: rtems: Avoid Giant lock for semaphores Update #2555. --- testsuites/tmtests/tm26/task1.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'testsuites/tmtests/tm26/task1.c') diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c index 5b19c3d3b6..a46f042ac6 100644 --- a/testsuites/tmtests/tm26/task1.c +++ b/testsuites/tmtests/tm26/task1.c @@ -575,8 +575,16 @@ void complete_test( void ) thread_get_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Semaphore_Get( Semaphore_id, &location ); + for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + ISR_lock_Context lock_context; + + (void) _Semaphore_Get_interrupt_disable( + Semaphore_id, + &location, + &lock_context + ); + _ISR_lock_ISR_enable( &lock_context ); + } semaphore_get_time = benchmark_timer_read(); benchmark_timer_initialize(); @@ -592,7 +600,7 @@ void complete_test( void ) set_thread_heir( _Thread_Get_executing() ); set_thread_dispatch_necessary( false ); - for (index = 0; index < 2 * OPERATION_COUNT; ++index) { + for (index = 0; index < OPERATION_COUNT; ++index) { _Thread_Unnest_dispatch(); } -- cgit v1.2.3