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

Add Mutex methods that ignore poisoning #35092

Closed
brson opened this Issue Jul 28, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@brson
Copy link
Contributor

brson commented Jul 28, 2016

Scenarios where one wants to ignore poisoning happen. Having to type extra incantations to ignore the poisoning can be quite unpleasant, makes Rust less ergonomic, and is a source of complaints. Let's please consider adding conveniences for cases where poisoning is not desired, either additional methods, or new types that do not poison.

@brson

This comment has been minimized.

Copy link
Contributor Author

brson commented Jul 28, 2016

For reference, this is what you type when you need to ignore poisoning: mutex.lock().unwrap_or_else(|e| e.into_inner())

@brson

This comment has been minimized.

Copy link
Contributor Author

brson commented Jul 28, 2016

Would be worthwhile to survey existing code bases to see how common it is to ignore poisoning.

@sfackler

This comment has been minimized.

Copy link
Member

sfackler commented Jul 28, 2016

I made a wrapper crate over the standard library types to do this: https://crates.io/crates/antidote

I have needed to poison a data structure exactly once in my career (Rust and not-Rust).

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 16, 2016

The libs team discussed this yesterday and the conclusion was that a change like this would require an RFC, so as a result we're going to close this in favor of a future incarnation in the rust-lang/rfcs repo.

@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Aug 31, 2016

Relatedly, I'd like PoisonError to turn into an empty type with panic=abort.

@glaebhoerl

This comment has been minimized.

Copy link
Contributor

glaebhoerl commented Aug 31, 2016

@Ericson2314 Wouldn't that break source compatibility? (Am I right to assume that panic=abort is not supposed to?)

@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Sep 2, 2016

@glaebhoerl sorry this would be a scenario thing where one can be portable/parametric wrt panic strategy, or rely on one and not work with the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.