zephyr/subsys
Marti Bolivar 1bfcea244b subsys: logging: fix trigger threshold corner case
The CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD option can be used to wake up
the background log processing thread when a given number of messages
have been queued.

Currently, the msg_finalize() routine which is responsible for
queueing a log message for later handling appends messages to the
global list after performing the threshold check and waking up the
thread.

This leads to a race condition with undesirable behavior if the
threshold == 1:

- the msg_finalize() thread is scheduled out by calling k_wakeup()
- the log processing thread wakes up, notice that no messages are
  queued, and goes back to sleep
- the msg_finalize() thread is scheduled back in and the message is
  queued for processing

This defers the handling of the message until the processing thread
wakes up again after the CONFIG_LOG_PROCESS_THREAD_SLEEP_MS timeout,
which is not what the user wants.

Fix this by queueing the message before waking up the handler thread.
(This also may improve responsiveness for larger threshold values.)

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-07-25 07:14:16 -04:00
..
bluetooth Bluetooth: controller: Fix disabling LE Encryption support 2018-07-25 13:52:03 +03:00
console
cpp
debug
dfu
disk
fs
logging subsys: logging: fix trigger threshold corner case 2018-07-25 07:14:16 -04:00
mgmt subsys: mgmt: Fix broken OTA firmware update 2018-07-18 14:32:06 +02:00
net net/icmpv4: Rename static function with icmpv4_ prefix 2018-07-24 17:22:58 +03:00
random
settings
shell
storage
usb
CMakeLists.txt
Kconfig