From 1bb3d56bd5aea47a88fc9ea4ebc3eb961f50c0d6 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 6 Aug 2020 12:46:26 +0200 Subject: [PATCH] core/msg: sched_threads[sched_active_pid] -> sched_active_thread Same result, but only a single volatile read. --- core/msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/msg.c b/core/msg.c index 2ebf98d8ed..fe203af28c 100644 --- a/core/msg.c +++ b/core/msg.c @@ -271,7 +271,7 @@ int msg_send_receive(msg_t *m, msg_t *reply, kernel_pid_t target_pid) { assert(sched_active_pid != target_pid); unsigned state = irq_disable(); - thread_t *me = (thread_t *)sched_threads[sched_active_pid]; + thread_t *me = (thread_t *)sched_active_thread; sched_set_status(me, STATUS_REPLY_BLOCKED); me->wait_data = (void *)reply; @@ -346,7 +346,7 @@ static int _msg_receive(msg_t *m, int block) DEBUG("_msg_receive: %" PRIkernel_pid ": _msg_receive.\n", sched_active_thread->pid); - thread_t *me = (thread_t *)sched_threads[sched_active_pid]; + thread_t *me = (thread_t *)sched_active_thread; int queue_index = -1;