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

Fix task blocking #753

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Fix task blocking #753

merged 3 commits into from
Nov 14, 2024

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Nov 13, 2024

Instead of incrementing the notificatin value via xTaskNotifyGive this will now set a specific bit in the task notification value
which will be tested before blocking a task. This will prevent a task from blocking indefinitely if the event that calls taskRelease
occurs before entering the blocked state.

Adds a config setting for the bit to set in the task notification value.
Refactor NimBLEClient::connect and NimBLEClient::secureConnection.

This change ensures that only the function that sets m_pTaskData clears it, potentially preventing a segmentation fault.

Client will no longer disconnect if task timeout occurs when waiting for MTU exchange response.

@h2zero h2zero force-pushed the fix-task-blocking branch 2 times, most recently from 6737aff to 8b944fe Compare November 14, 2024 16:48
…cking.

Instead of incrementing the notificatin value via `xTaskNotifyGive` this will now set a specific bit in the task notification value
which will be tested before blocking a task. This will prevent a task from blocking indefinitely if the event that calls `taskRelease`
occurs before entering the blocked state.

* Adds a config setting for the bit to set in the task notification value.
* Create destructor for NimBLETaskData to delete semaphore if created.
This change ensures that only the function that sets `m_pTaskData` clears it, potentially preventing a segmentation fault.

* Client will no longer disconnect if task timeout occurs when waiting for MTU exchange response.
@h2zero h2zero merged commit e366800 into master Nov 14, 2024
31 checks passed
@h2zero h2zero deleted the fix-task-blocking branch November 14, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant