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

Support parking_lot::Condvar #20

Open
bertptrs opened this issue May 17, 2022 · 0 comments
Open

Support parking_lot::Condvar #20

bertptrs opened this issue May 17, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@bertptrs
Copy link
Owner

It would be nice if this crate could support parking_lot::Condvar similar to std::sync::Condvar is supported. Unfortunately, the approach taken for std doesn't work.

For std, we unwrap the passed mutex guard and simply pass that to the wrapped Condvar. For parking lot this does not work for two reasons:

  1. The Condvar accepts the guard by mutable reference rather than by value. This prevents destructuring, but that turns out to not be a problem because
  2. It appears "impossible" to get a parking_lot::MutexGuard from a tracing_mutex::parkinglot::TracingMutexGuard. The added indirection of the lock_api primitives and private fields means we cannot just access that.

The word impossible is intentionally in quotes because I'm nowhere near sure that there's actually no way to do it.

@bertptrs bertptrs added the enhancement New feature or request label May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant