Re: Scheduler/Thread Status #api


Andy Ross
 

Not public ones, no.  You can check kernel/include/ksched.h for the internal API for this.  I guess the immediate question has to be "what are you trying to do"?  Recognize that any decision made on the basis of this kind of stuff is going to be inherently racy without access to the scheduler's own synchronization (though on a single CPU device, just holding an interrupt lock is enough to be safe).

Also, just to clarify: k_sched_lock() doesn't mutate "scheduler" state at all, it's implemented via a trick that essentially elevates the current thread priority to a cooperative level, preventing preemption.

Andy

Join users@lists.zephyrproject.org to automatically receive all group messages.