-
Notifications
You must be signed in to change notification settings - Fork 0
Error handling #32
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
Error handling #32
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,8 @@ impl<T> Lock<T> { | |
| where | ||
| F: FnOnce(&mut T) -> R, | ||
| { | ||
| let mut lock = self.lock.lock().unwrap(); | ||
| // Not attempting poison recovery. | ||
| let mut lock = self.lock.lock().expect("poisoned lock"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is ok? We're trying to build our software to avoid panics so I would think that a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's poisoned then something has panicked so the only thing you can really do is also panic |
||
| f(&mut lock) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that the
preandpostextensions were optional and might very well beNone... I may have imagined that though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ignore my previous comment, this is fine in this context.