mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-24 14:35:46 +00:00
Check if next ready thread is same as current thread before calling z_swap. This avoids calling swap to just go back to the original thread. Original code: thread 0x20000118 switches out and then in again... >> 0x20000118 gives semaphore(signal): 0x20000104 (count: 0) >> thread ready: 0x20000118 >> 0x20000118 switched out >> 0x20000118 switched in >> end call to k_sem_give >> 0x20000118 takes semaphore(wait): 0x200000f4 (count: 0) >> thread pend: 0x20000118 >> 0x20000118 switched out >> 0x200001d0 switched in with this patch: >> 0x200001d0 gives semaphore(signal): 0x200000f4 (count: 0) >> thread ready: 0x200001d0 >> end call to k_sem_give >> 0x200001d0 takes semaphore(wait): 0x20000104 (count: 0) >> thread pend: 0x200001d0 >> 0x200001d0 switched out >> 0x20000118 switched in >> end call to k_sem_take The above is output from tracing with a custom format used for debugging. Signed-off-by: Anas Nashif <anas.nashif@intel.com> |
||
---|---|---|
.. | ||
include | ||
atomic_c.c | ||
cache_handlers.c | ||
CMakeLists.txt | ||
compiler_stack_protect.c | ||
device.c | ||
errno.c | ||
fatal.c | ||
futex.c | ||
idle.c | ||
init.c | ||
Kconfig | ||
Kconfig.power_mgmt | ||
kheap.c | ||
mailbox.c | ||
mem_domain.c | ||
mem_slab.c | ||
mempool_sys.c | ||
mempool.c | ||
mmu.c | ||
msg_q.c | ||
mutex.c | ||
pipes.c | ||
poll.c | ||
queue.c | ||
sched.c | ||
sem.c | ||
smp.c | ||
stack.c | ||
system_work_q.c | ||
thread_abort.c | ||
thread.c | ||
timeout.c | ||
timer.c | ||
userspace_handler.c | ||
userspace.c | ||
version.c | ||
work_q.c |