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

[wpiutil] Add ManagedStatic #7739

Draft
wants to merge 4 commits into
base: 2027
Choose a base branch
from

Conversation

PeterJohnson
Copy link
Member

@PeterJohnson PeterJohnson commented Jan 27, 2025

This import from LLVM adds a wpi_shutdown() function to explicitly destroy all managed static instances.

This import from LLVM adds a wpi_shutdown() function to explicitly destroy
all managed static instances.
@github-actions github-actions bot added component: wpiutil WPI utility library 2027 2027 target labels Jan 27, 2025
Comment on lines +71 to +72
/// IMPORTANT: it's only safe to call wpi_shutdown() in single thread,
/// without any other threads executing LLVM APIs.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment since it's thread safe now.

}
}

void ManagedStaticBase::destroy() const {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment about this not being thread-safe if called individually.

@github-actions github-actions bot added the component: wpilibc WPILib C++ label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2027 2027 target component: wpilibc WPILib C++ component: wpiutil WPI utility library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants