diff --git a/miosix/kernel/kernel.cpp b/miosix/kernel/kernel.cpp index a854c073d14b0ef46e595175ee819ea97d0c4811..f2e785186691db20d2c1a7e6a947050cc47dd506 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 98782a5015f2b904c80c3daea713e7a218a46988..e1b6fdf0cae4f72fc7f90be9e491327b747c1905 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