diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-17 14:54:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 07:49:40 +0200 |
commit | 5eac967651866b0501593dcfea458452ef9e9128 (patch) | |
tree | 318c199360e7f6eef5f78412e4c6b037aba7ea6f /testsuites/tmtests/tm26/task1.c | |
parent | sptests/spintrcritical22: Avoid _Objects_Get() (diff) | |
download | rtems-5eac967651866b0501593dcfea458452ef9e9128.tar.bz2 |
testsuites: Replace _Thread_Get()
Replace _Thread_Get() with _Thread_Get_interrupt_disable() to avoid the
Giant lock.
Update #2555.
Diffstat (limited to 'testsuites/tmtests/tm26/task1.c')
-rw-r--r-- | testsuites/tmtests/tm26/task1.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c index 66bd4091b8..babd240c47 100644 --- a/testsuites/tmtests/tm26/task1.c +++ b/testsuites/tmtests/tm26/task1.c @@ -543,8 +543,9 @@ rtems_task Floating_point_task_2( void complete_test( void ) { - uint32_t index; - rtems_id task_id; + uint32_t index; + rtems_id task_id; + ISR_lock_Context lock_context; benchmark_timer_initialize(); thread_resume( Middle_tcb ); @@ -570,14 +571,14 @@ void complete_test( void ) task_id = Middle_tcb->Object.id; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( task_id, &location ); + for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + (void) _Thread_Get_interrupt_disable( task_id, &lock_context ); + _ISR_lock_ISR_enable( &lock_context ); + } thread_get_time = benchmark_timer_read(); benchmark_timer_initialize(); for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - ISR_lock_Context lock_context; - (void) _Semaphore_Get_interrupt_disable( Semaphore_id, &location, @@ -588,8 +589,10 @@ void complete_test( void ) semaphore_get_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( 0x3, &location ); + for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + (void) _Thread_Get_interrupt_disable( 0x3, &lock_context ); + _ISR_lock_ISR_enable( &lock_context ); + } thread_get_invalid_time = benchmark_timer_read(); /* @@ -755,7 +758,7 @@ void complete_test( void ) ); put_time( - "rtems internal: _Thread_Get", + "rtems internal: _Thread_Get_interrupt_disable", thread_get_time, OPERATION_COUNT, 0, @@ -763,7 +766,7 @@ void complete_test( void ) ); put_time( - "rtems internal: _Semaphore_Get", + "rtems internal: _Semaphore_Get_interrupt_disable", semaphore_get_time, OPERATION_COUNT, 0, @@ -771,7 +774,7 @@ void complete_test( void ) ); put_time( - "rtems internal: _Thread_Get: invalid id", + "rtems internal: _Thread_Get_interrupt_disable: invalid id", thread_get_invalid_time, OPERATION_COUNT, 0, |