You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letmut state = SharedState::try_new()?;letmut state2 = SharedState::try_new()?;
core::mem::swap(Arc::get_mut(&mut state).unwrap(),Arc::get_mut(&mut state2).unwrap());
but this swaps two pinned CondVar, which is unsound. After pinning the CondVar, we shouldn't be able to obtain any Arc<SharedState>, but rather only Pin<Arc<SharedState>>.
Activity
alex commentedon May 22, 2021
The right fix here is:
a) To pin the
Arcimmediately here: https://github.com/Rust-for-Linux/linux/blob/rust/samples/rust/rust_miscdev.rs#L42b) To change teh return type to
Pin<Arc<SharedState>>here: https://github.com/Rust-for-Linux/linux/blob/rust/samples/rust/rust_miscdev.rs#L41c) To update anything else to get it to compile :-)