Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Less Mutex poisoning #527

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Less Mutex poisoning #527

merged 1 commit into from
Feb 24, 2024

Conversation

asomers
Copy link
Owner

@asomers asomers commented Dec 9, 2023

If a test case panics while holding a static method's internal Mutex locked, for example by violating a times() constraint, then clear the Mutex's poison during Drop. We're going to delete all of its Expectations anyway, so there's no data to be poisoned.

Requires nightly.

Fixes #515

@asomers
Copy link
Owner Author

asomers commented Dec 9, 2023

This PR depends on the rust-lang/rust#96469 feature, which should be merged soon.

@asomers asomers force-pushed the clear_poison branch 3 times, most recently from 8161721 to 387b161 Compare February 24, 2024 20:24
If a test case panics while holding a static method's internal Mutex
locked, for example by violating a times() constraint, then clear the
Mutex's poison during Drop.  We're going to delete all of its
Expectations anyway, so there's no data to be poisoned.

Requires nightly.

Fixes #515
@asomers asomers merged commit b4c7318 into master Feb 24, 2024
3 checks passed
@asomers asomers deleted the clear_poison branch February 24, 2024 22:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce mutex poisoning
1 participant