Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gen4] fixes a BLE lockup circumstance #2836

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

XuGuohui
Copy link
Member

@XuGuohui XuGuohui commented Oct 15, 2024

Problem

There is deadlock happening among multi-threads.

  1. Custom thread acquired the HAL BLE lock when calling BLE.connect(), relying on BLE event thread to release the lock, thus, suspended.
  2. User thread acquired the wiring BLE lock when calling BLE.peerCentral(), followed by trying acquiring the HAL BLE lock, thus, suspended.
  3. BLE event thread tries acquiring the wiring BLE lock when invoking callback, thus, suspended.

Solution

Try acquiring BLE hal lock for query APIs.

Steps to Test

More info can be found here

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui requested a review from avtolstoy October 15, 2024 16:46
@XuGuohui XuGuohui added bug ble Bluetooth Low Energy labels Oct 15, 2024
@XuGuohui XuGuohui added this to the 6.2.0 milestone Oct 15, 2024
@Kategrode Kategrode modified the milestones: 6.2.0, 6.2.1 Oct 15, 2024
@XuGuohui XuGuohui requested a review from avtolstoy October 21, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ble Bluetooth Low Energy bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants