zephyr/kernel/include
Benjamin Walsh 8d7c274e55 kernel/sched: protect thread sched_lock with compiler barriers
This has not bitten us yet, but it was a ticking timebomb.

This is similar to the issue that was found with irq_lock/irq_unlock
implementations on several architectures. Having a volatile variable is
not the way to force the sched_lock variable to be
incremented/decremented around the accesses to data it protects.
Instead, a compiler barrier must prevent the compiler from reordering
the memory accesses around setting of sched_lock. Needed in the inline
implementations _sched_lock()/_sched_unlock_no_reschedule(), which
resolve to simple decrement/increment of the per-thread sched_lock
variable.

Change-Id: I06f5b3524889f193efe69caa947118404b1be0b5
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-16 04:56:21 +00:00
..
gen_offset.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
kernel_offsets.h kernel/arch: streamline thread user options 2017-01-24 13:34:50 +00:00
kernel_structs.h kernel/sched: protect thread sched_lock with compiler barriers 2017-02-16 04:56:21 +00:00
ksched.h kernel/sched: protect thread sched_lock with compiler barriers 2017-02-16 04:56:21 +00:00
nano_internal.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
offsets_short.h kernel/arch: streamline thread user options 2017-01-24 13:34:50 +00:00
timeout_q.h kernel: Use SYS_DLIST_FOR_EACH_CONTAINER 2017-02-10 16:16:14 +00:00
wait_q.h kernel: add _WAIT_Q_INIT() 2017-02-02 00:30:00 +00:00