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

C++ ADIS classes use volatile instead of atomic, which creates race conditions #6213

Closed
calcmogul opened this issue Jan 12, 2024 · 0 comments · Fixed by #6217
Closed

C++ ADIS classes use volatile instead of atomic, which creates race conditions #6213

calcmogul opened this issue Jan 12, 2024 · 0 comments · Fixed by #6217
Labels
component: wpilibc WPILib C++ type: bug Something isn't working.

Comments

@calcmogul
Copy link
Member

calcmogul commented Jan 12, 2024

The C++ ADIS classes should use std::atomic<bool> instead for cross-thread communication. User-defined move constructors and move assignment operators will be required since atomics aren't movable. .load() should be used to assign the moved-to atomic object.

@calcmogul calcmogul added type: bug Something isn't working. component: wpilibc WPILib C++ labels Jan 12, 2024
@calcmogul calcmogul changed the title ADIS classes use volatile instead of atomic, which creates race conditions C++ ADIS classes use volatile instead of atomic, which creates race conditions Jan 12, 2024
spacey-sooty added a commit to spacey-sooty/allwpilib that referenced this issue Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpilibc WPILib C++ type: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant