Commit c19eed0
fw/services/hrm_manager: fix assert in prv_system_task_hrm_handler
Check if data is available in the circular buffer before attempting to
read in prv_system_task_hrm_handler(). This prevents an assertion
failure when system task callbacks are queued without corresponding
events in the buffer, which can occur during high system load such as
voice dictation session startup.
The race condition occurs when:
- prv_event_put() queues an event and calls system_task_add_callback()
- Multiple callbacks may be queued rapidly during system load
- One callback processes and consumes the event
- Another callback runs but finds the buffer empty
Instead of asserting and crashing, we now log a warning and return
gracefully. HRM functionality continues normally as new events arrive.
Signed-off-by: Joshua Jun <joshuajun@proton.me>1 parent 9605902 commit c19eed0
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
372 | 385 | | |
373 | 386 | | |
374 | 387 | | |
| |||
0 commit comments