Skip to content

Fix race conditions in TreeView #1105

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roelvandergoot
Copy link

When you:
1.Represent a directory tree as a TreeView,
2. Use a state machine go-routine per leaf TreeNode, and
3. Append the current state name of the state machine to the TreeNode's using TreeNode.SetText(),
a race condition exists between TreeNode.SetText() and TreeView.Draw()

You can't solve the race condition by embedding rivo.TreeView and rivo.TreeNodes in your own TreeView and TreeNodes. Hence this pull request.

@roelvandergoot
Copy link
Author

roelvandergoot commented Jul 26, 2025

Let me know if you want me to rename mu or place it somewhere else in the TreeNode struct or add mus to other widgets. Then again you can also feel free to make your own alternate (better according to you) merge request. :)

BTW. I love this repository! Thank you very much for providing it.

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