Skip to content

Commit 17755c1

Browse files
committed
[nrf noup] Bluetooth: Host: deadlock fix testing.
This is just to test a still open PR on RTOS Zephyr. Signed-off-by: Kyra Lengfeld <[email protected]>
1 parent 71b0e2c commit 17755c1

File tree

1 file changed

+8
-1
lines changed
  • subsys/bluetooth/host

1 file changed

+8
-1
lines changed

subsys/bluetooth/host/att.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,14 @@ static struct net_buf *bt_att_chan_create_pdu(struct bt_att_chan *chan, uint8_t
721721
timeout = BT_ATT_TIMEOUT;
722722
break;
723723
default:
724-
timeout = K_FOREVER;
724+
k_tid_t current_thread = k_current_get();
725+
726+
if (current_thread == att_handle_rsp_thread) {
727+
/* Blocking would cause deadlock. */
728+
timeout = K_NO_WAIT;
729+
} else {
730+
timeout = K_FOREVER;
731+
}
725732
}
726733

727734
/* This will reserve headspace for lower layers */

0 commit comments

Comments
 (0)