Skip to content

Commit

Permalink
bluetooth: host: bt_disable: Let threads run before aborting
Browse files Browse the repository at this point in the history
This means we can raise the disconnected events which are
pending from `bt_conn_cleanup_all` if bt_disable is called
a cooperative thread.

Without this the events were not raised until bluetooth
was enabled again.

fixes #72721

Signed-off-by: Sean Madigan <[email protected]>
  • Loading branch information
sean-madigan committed Jul 2, 2024
1 parent 6700a15 commit 3e80b61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions subsys/bluetooth/host/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4329,6 +4329,9 @@ int bt_disable(void)
disconnected_handles_reset();
#endif /* CONFIG_BT_CONN */

/* Let threads run before aborting */
k_yield();

#if defined(CONFIG_BT_RECV_WORKQ_BT)
/* Abort RX thread */
k_thread_abort(&bt_workq.thread);
Expand Down

0 comments on commit 3e80b61

Please sign in to comment.