Initial (optional) triomphe::Arc support#454
Conversation
Amanieu
left a comment
There was a problem hiding this comment.
Sorry for the late response, this slipped off my review queue.
Overall, I'm very much in favor of adding triomphe support, but the issue with the way the code is written is that it doesn't allow both std::sync::Arc and triomphe::Arc to be supported at the same time. Instead, I would prefer if methods like arc_lock were generic over a trait which is implemented for both std::sync::Arc and triomphe::Arc (and possibly other Arc variants from triomphe).
| mod tests { | ||
| use crate::{Condvar, Mutex, MutexGuard}; | ||
| use std::sync::mpsc::channel; | ||
| #[cfg(not(feature = "triomphe"))] |
There was a problem hiding this comment.
There's no need to do this for tests, we can always use std::sync::Arc there.
That makes a lot of sense. But it does sound like quite a bit of work unless I miss something? I am afraid it will be a long time before I can work on this -- if ever. This PR came to be because we use a forked |
See subject.
This adds support for swapping out
std::sync::Arc(parking_lot) resp.alloc::sync::Arc(lock_api) fortriomphe::Arc.Both crates had a
triomphefeature added but alternatively I could put this behind atriomphe_arc_lockfeature instead.Or even
arc_de_triomphe_lock, to fully express the presumed naming intent of that crate. 😉I need this for a project I'm working on so I thought I may as well open a PR, in case this is useful. If not, just close the PR and ignore.