zephyr/kernel
Michael Scott 6c95dafd82 kernel: sched: use _is_thread_ready() in should_preempt()
We are using _is_thread_prevented_from_running() to see if the
_current thread can be preempted in should_preempt().  The idea
being that even if the _current thread is a high priority coop
thread, we can still preempt it when it's pending, suspended,
etc.

This does not take into account if the thread is sleeping.

k_sleep() merely removes the thread from the ready_q and calls
Swap().  The scheduler will swap away from the thread temporarily
and then on the next cycle get stuck to the sleeping thread for
however long the sleep timeout is, doing exactly nothing because
other functions like _ready_thread() use _is_thread_ready() as a
check before proceeding.

We should use !_is_thread_ready() to take into account when threads
are waiting on a timer, and let other threads run in the meantime.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-06-04 08:21:47 -04:00
..
include kernel/sched: Fix SMP scheduling 2018-05-31 14:02:03 -04:00
CMakeLists.txt kernel: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for kernel files. 2018-05-15 17:48:18 +03:00
Kconfig arch: x86: Rename CPU_NO_SPECTRE to CPU_NO_SPECTRE_V2 2018-05-24 13:07:12 -04:00
Kconfig.event_logger
Kconfig.power_mgmt
alert.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
atomic_c.c
compiler_stack_protect.c kernel: add CODE_UNREACHABLE in _StackCheckHandler 2018-04-17 10:50:12 -07:00
device.c
errno.c
idle.c kernel: Rework SMP irq_lock() compatibility layer 2018-05-02 10:00:17 -07:00
init.c kernel: Use IS-specific entropy function when available 2018-05-24 15:13:13 -07:00
int_latency_bench.c
mailbox.c kernel: Fix sloppy wait queue API 2018-05-18 01:48:48 +03:00
mem_domain.c
mem_slab.c kernel: mem_slab: Reschedule in k_mem_slab_free only when necessary. 2018-05-18 20:16:50 +03:00
mempool.c kernel/mempool: Handle transient failure condition 2018-05-27 09:55:04 -04:00
msg_q.c kernel: Wait queues aren't dlists anymore 2018-05-19 07:00:55 +03:00
mutex.c kernel: Fix sloppy wait queue API 2018-05-18 01:48:48 +03:00
pipes.c kernel: Wait queues aren't dlists anymore 2018-05-19 07:00:55 +03:00
poll.c k_poll: expose to user mode 2018-05-17 23:34:03 +03:00
queue.c kernel: Fix sloppy wait queue API 2018-05-18 01:48:48 +03:00
sched.c kernel: sched: use _is_thread_ready() in should_preempt() 2018-06-04 08:21:47 -04:00
sem.c kernel: Fix sloppy wait queue API 2018-05-18 01:48:48 +03:00
smp.c kernel: Rework SMP irq_lock() compatibility layer 2018-05-02 10:00:17 -07:00
stack.c kernel: Wait queues aren't dlists anymore 2018-05-19 07:00:55 +03:00
sys_clock.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
system_work_q.c
thread.c kernel: thread: fix _THREAD_DUMMY check in _check_stack_sentinel() 2018-06-01 09:03:48 -04:00
thread_abort.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
timer.c kernel: Fix sloppy wait queue API 2018-05-18 01:48:48 +03:00
userspace.c userspace: generate list of kernel object sizes 2018-05-16 17:32:59 -07:00
userspace_handler.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
version.c
work_q.c