Files
Jakub Rzeszutko a04d8957c2 shell: fix race condition between prompt print and RX buffer flush
Move z_shell_backend_rx_buffer_flush() before state_set() in
shell_start() to prevent a race condition where incoming shell
commands could be lost.

Previously, the sequence was:
1. state_set() - prints the prompt
2. z_shell_backend_rx_buffer_flush() - flushes RX buffer

If the shell thread was preempted after printing the prompt,
the host could see the prompt and send commands. When the
thread resumed, z_shell_backend_rx_buffer_flush() would discard
those commands.

By flushing the RX buffer before printing the prompt, any
commands received after the prompt is visible will not be
affected by the flush operation.

Fixes #99674

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2026-01-23 09:21:43 -06:00
..
2025-11-18 08:08:40 -05:00
2025-11-21 10:09:08 +02:00
2025-07-22 19:34:02 -04:00
2025-07-24 17:00:07 +01:00