summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests/tm27/task1.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-19 21:38:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-19 21:38:52 +0200
commitf9090ac82db79947c5d989d133cf148fbf385501 (patch)
tree7ba32c5539159f2b8b66ca7f9764d0762e704f38 /testsuites/tmtests/tm27/task1.c
parentsptests/sp37: Fix type and simplify (diff)
downloadrtems-f9090ac82db79947c5d989d133cf148fbf385501.tar.bz2
tmtests/tm27: Use scheduler lock
Diffstat (limited to 'testsuites/tmtests/tm27/task1.c')
-rw-r--r--testsuites/tmtests/tm27/task1.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index 3d02e911bf..d351b4145a 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -224,11 +224,10 @@ rtems_task Task_2(
rtems_task_argument argument
)
{
+ Thread_Control *executing = _Thread_Get_executing();
Scheduler_priority_Context *scheduler_context =
- _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
-#if defined(RTEMS_SMP)
- rtems_interrupt_level level;
-#endif
+ _Scheduler_priority_Get_context( _Scheduler_Get( executing ) );
+ ISR_lock_Context lock_context;
#if (MUST_WAIT_FOR_INTERRUPT == 1)
while ( Interrupt_occurred == 0 );
@@ -257,18 +256,14 @@ rtems_task Task_2(
* Switch back to the other task to exit the test.
*/
-#if defined(RTEMS_SMP)
- rtems_interrupt_disable(level);
-#endif
+ _Scheduler_Acquire( executing, &lock_context );
_Thread_Executing =
(Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]);
_Thread_Dispatch_necessary = 1;
-#if defined(RTEMS_SMP)
- rtems_interrupt_enable(level);
-#endif
+ _Scheduler_Release( executing, &lock_context );
_Thread_Dispatch();