forked from Imagelibrary/rtems
tmtests/tm27: Use scheduler lock
This commit is contained in:
@@ -224,11 +224,10 @@ rtems_task Task_2(
|
|||||||
rtems_task_argument argument
|
rtems_task_argument argument
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
Thread_Control *executing = _Thread_Get_executing();
|
||||||
Scheduler_priority_Context *scheduler_context =
|
Scheduler_priority_Context *scheduler_context =
|
||||||
_Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
|
_Scheduler_priority_Get_context( _Scheduler_Get( executing ) );
|
||||||
#if defined(RTEMS_SMP)
|
ISR_lock_Context lock_context;
|
||||||
rtems_interrupt_level level;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (MUST_WAIT_FOR_INTERRUPT == 1)
|
#if (MUST_WAIT_FOR_INTERRUPT == 1)
|
||||||
while ( Interrupt_occurred == 0 );
|
while ( Interrupt_occurred == 0 );
|
||||||
@@ -257,18 +256,14 @@ rtems_task Task_2(
|
|||||||
* Switch back to the other task to exit the test.
|
* Switch back to the other task to exit the test.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(RTEMS_SMP)
|
_Scheduler_Acquire( executing, &lock_context );
|
||||||
rtems_interrupt_disable(level);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_Thread_Executing =
|
_Thread_Executing =
|
||||||
(Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]);
|
(Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]);
|
||||||
|
|
||||||
_Thread_Dispatch_necessary = 1;
|
_Thread_Dispatch_necessary = 1;
|
||||||
|
|
||||||
#if defined(RTEMS_SMP)
|
_Scheduler_Release( executing, &lock_context );
|
||||||
rtems_interrupt_enable(level);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_Thread_Dispatch();
|
_Thread_Dispatch();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user