summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests/tm27/task1.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/tmtests/tm27/task1.c')
-rw-r--r--testsuites/tmtests/tm27/task1.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index 9126391d59..c89c0956f1 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -46,6 +46,11 @@ rtems_isr Isr_handler(
rtems_vector_number vector
);
+static void set_thread_executing( Thread_Control *thread )
+{
+ _Per_CPU_Get_snapshot()->executing = thread;
+}
+
rtems_task Init(
rtems_task_argument argument
)
@@ -191,8 +196,9 @@ rtems_task Task_1(
_ISR_Local_disable(level);
#endif
- _Thread_Executing =
- (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]);
+ set_thread_executing(
+ (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY])
+ );
_Thread_Dispatch_necessary = 1;
@@ -265,8 +271,9 @@ rtems_task Task_2(
_Thread_State_acquire( executing, &state_lock_context );
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
- _Thread_Executing =
- (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]);
+ set_thread_executing(
+ (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY])
+ );
_Thread_Dispatch_necessary = 1;