diff --git a/src/context/switch.rs b/src/context/switch.rs index 0077ea06..ea2ef7e0 100644 --- a/src/context/switch.rs +++ b/src/context/switch.rs @@ -50,7 +50,7 @@ pub const STEAL_INTERVAL: usize = 2; pub const MAX_STEAL: usize = 2; unsafe fn opportunistic_write_arc(lock: &Arc) -> Option { - if cfg!(opportunistic_context_locking) { + if cfg!(feature = "opportunistic_context_locking") { unsafe { lock.try_write_arc() } } else { Some(unsafe { lock.write_arc() }) @@ -260,7 +260,7 @@ pub fn switch(token: &mut CleanLockToken) -> SwitchResult { continue; }; // TODO: can this happen? - if !cfg!(opportunistic_context_locking) + if !cfg!(feature = "opportunistic_context_locking") && Weak::as_ptr(&context_ref.0) == Arc::as_ptr(&ArcRwLockWriteGuard::rwlock(&prev_context_guard)) {