From 85860a5756a6eac0d237f2332f427ce82bd4b165 Mon Sep 17 00:00:00 2001 From: Terraneo Federico <fede.tft@miosix.org> Date: Sun, 7 May 2023 23:33:39 +0200 Subject: [PATCH] Thread::IRQexists is now private, it was only used internally --- miosix/kernel/kernel.cpp | 16 ++++++++-------- miosix/kernel/kernel.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/miosix/kernel/kernel.cpp b/miosix/kernel/kernel.cpp index a854c073..f2e78518 100755 --- a/miosix/kernel/kernel.cpp +++ b/miosix/kernel/kernel.cpp @@ -481,14 +481,6 @@ bool Thread::exists(Thread *p) return Scheduler::PKexists(p); } -bool Thread::IRQexists(Thread* p) -{ - if(p==nullptr) return false; - //NOTE: the code in all schedulers is currently safe to be called also with - //interrupts disabled - return Scheduler::PKexists(p); -} - Priority Thread::getPriority() { //NOTE: the code in all schedulers is currently safe to be called either @@ -860,6 +852,14 @@ TimedWaitResult Thread::IRQenableIrqAndTimedWaitImpl(long long absoluteTimeNs) return removed ? TimedWaitResult::NoTimeout : TimedWaitResult::Timeout; } +bool Thread::IRQexists(Thread* p) +{ + if(p==nullptr) return false; + //NOTE: the code in all schedulers is currently safe to be called also with + //interrupts disabled + return Scheduler::PKexists(p); +} + Thread *Thread::allocateIdleThread() { //NOTE: this function is only called once before the kernel is started, so diff --git a/miosix/kernel/kernel.h b/miosix/kernel/kernel.h index 98782a50..e1b6fdf0 100755 --- a/miosix/kernel/kernel.h +++ b/miosix/kernel/kernel.h @@ -771,12 +771,6 @@ public: */ static bool exists(Thread *p); - /** - * Same as exists() but is meant to be called only inside an IRQ or when - * interrupts are disabled. - */ - static bool IRQexists(Thread *p); - /** * Returns the priority of a thread.<br> * To get the priority of the current thread use: @@ -1157,6 +1151,12 @@ private: */ static TimedWaitResult IRQenableIrqAndTimedWaitImpl(long long absoluteTimeNs); + /** + * Same as exists() but is meant to be called only inside an IRQ or when + * interrupts are disabled. + */ + static bool IRQexists(Thread *p); + /** * Allocates the idle thread and makes cur point to it * Can only be called before the kernel is started, is called exactly once -- GitLab