zephyr/kernel
Andy Ross 8bdabcc46b kernel/sched: Move thread suspend and abort under the scheduler lock
Historically, these routines were placed in thread.c and would use the
scheduler via exported, synchronized functions (e.g. "remove from
ready queue").  But those steps were very fine grained, and there were
races where the thread could be seen by other contexts (in particular
under SMP) in an intermediate state.  It's not completely clear to me
that any of these were fatal bugs, but it's very hard to prove they
weren't.

At best, this is fragile.  Move the z_thread_single_suspend/abort()
functions into the scheduler and do the scheduler logic in a single
critical section.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-08 14:21:10 +01:00
..
include kernel: use 'thread' for thread variable consistently 2019-12-21 19:57:57 -05:00
atomic_c.c kernel: fix the bug in atomic_c.c 2019-09-26 21:13:20 -04:00
CMakeLists.txt headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
compiler_stack_protect.c kernel: Fix gcc-9.2 warning with _StackCheckHandler 2019-10-04 05:22:30 -07:00
device.c kernel: move test of kernel startup state to more visible location 2020-01-06 13:55:31 -05:00
errno.c headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
fatal.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
futex.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
idle.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
init.c kernel: move test of kernel startup state to more visible location 2020-01-06 13:55:31 -05:00
Kconfig kconfig: Remove '# hidden' comment on ARCH_HAS_CUSTOM_BUSY_WAIT 2020-01-06 13:34:00 -05:00
Kconfig.power_mgmt kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
mailbox.c global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
mem_domain.c kernel: fix k_mem_partition data types 2019-12-12 14:48:42 -08:00
mem_slab.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
mempool.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
msg_q.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
mutex.c kernel/mutex: code improvement 2020-01-07 17:13:37 +01:00
pipes.c headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
poll.c kernel: poll: Allow 0 event input 2020-01-03 11:26:46 -08:00
queue.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
sched.c kernel/sched: Move thread suspend and abort under the scheduler lock 2020-01-08 14:21:10 +01:00
sem.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
smp.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
stack.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
system_work_q.c kernel: system_work_q: Set dedicated "sysworkq" name. 2018-10-19 07:58:45 -04:00
thread_abort.c kernel/sched: Move thread suspend and abort under the scheduler lock 2020-01-08 14:21:10 +01:00
thread.c kernel/sched: Move thread suspend and abort under the scheduler lock 2020-01-08 14:21:10 +01:00
timeout.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
timer.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
userspace_handler.c kernel: remove vestigal printk references 2019-10-01 16:15:06 -05:00
userspace.c kernel: use 'thread' for thread variable consistently 2019-12-21 19:57:57 -05:00
version.c doc: add kernel version API to doxygen 2018-12-08 17:24:53 -05:00
work_q.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00