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 data race when rendering an LCD display #1

Conversation

juhdanad
Copy link

@juhdanad juhdanad commented Oct 6, 2022

###Summary

The example code for the LCD display uses two threads: one for simulating the AVR chip, and one for OpenGL. The state of the LCD display is stored as some flags in a uint16_t variable. When the OpenGL thread modifies a flag, it may accidentally undo a simultaneous write operation in the AVR thread, causing malfunction of the display.

The full description is available at buserror#507.

@juhdanad
Copy link
Author

juhdanad commented Oct 6, 2022

Sorry for force-pushing, I had to fix a minor mistake in the first commit, and I had to modify the first commit itself as it is required for testing the PR. I hope I was fast enough to not cause any trouble.

@akosthekiss
Copy link
Owner

Thanks for the patch. I have cherry-picked the important part of the "Add mutex to LCD display to prevent race condition" patch into the branch. Better late than never.

@akosthekiss akosthekiss closed this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants