Fix joining thread on serial disconnect#710
Merged
1Blademaster merged 1 commit intorelease-alpha-0.1.10from Sep 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the thread joining logic in the stopAllThreads method to avoid potential deadlocks by ensuring threads don't try to join themselves. The change replaces individual thread join calls with a loop that checks if each thread exists, is alive, and is not the current thread before attempting to join it.
Key Changes:
- Replaced multiple individual thread.join() calls with a single loop
- Added current thread detection to prevent self-joining
- Added null and alive checks for thread safety
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
NexInfinite
approved these changes
Sep 23, 2025
Contributor
NexInfinite
left a comment
There was a problem hiding this comment.
if thread is not None and thread.is_alive() and thread is not this_thread: I love how easy python is to read compared to JS, I miss python PRs. Codes good tho 👍🏻
1Blademaster
added a commit
that referenced
this pull request
Sep 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.