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

Remove parking_lot dependency now that std's Mutex is faster than before #138

Open
antoyo opened this issue Dec 31, 2022 · 3 comments · May be fixed by #140
Open

Remove parking_lot dependency now that std's Mutex is faster than before #138

antoyo opened this issue Dec 31, 2022 · 3 comments · May be fixed by #140

Comments

@antoyo
Copy link

antoyo commented Dec 31, 2022

Hi.
Do you think we could remove the dependency to parking_lot now that std's Mutex is faster than before?
Regards.

@sfackler
Copy link
Owner

Why?

parking_lot also avoids the poisoning behavior.

@antoyo
Copy link
Author

antoyo commented Dec 31, 2022

Oh, I thought it was used for performance reasons. So, removing it would reduce the build time.

But if it was used to avoid this behavior, then I guess there's no reason to remove it.

@BratSinot
Copy link

parking_lot also avoids the poisoning behavior.

You can get same behaviour by simple wrapper:

struct Mutex<T>(std::sync::Mutex<T>);

impl<T> Mutex<T> {
    pub fn lock(&self) -> std::sync::MutexGuard<T> {
        self.0.lock().unwrap_or_else(PoisonError::into_inner)
    }
}

@BratSinot BratSinot linked a pull request Feb 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants