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-07-01 10:58:54 -10:00
2025-12-12 09:56:43 -05:00
2024-07-30 18:28:17 +01:00
2025-12-01 12:23:41 -05:00
2025-07-21 09:19:14 -04:00
2026-01-15 16:40:29 +00:00
2026-01-16 11:42:50 +00:00
2026-01-22 12:54:52 -05:00
2024-06-22 05:40:22 -04:00
2025-10-22 09:02:38 +02:00
2025-10-22 09:02:38 +02:00