mirror of
https://github.com/redox-os/kernel.git
synced 2026-09-09 00:07:34 +08:00
Fix obvious opportunistic_context_locking typo.
This commit is contained in:
@@ -50,7 +50,7 @@ pub const STEAL_INTERVAL: usize = 2;
|
||||
pub const MAX_STEAL: usize = 2;
|
||||
|
||||
unsafe fn opportunistic_write_arc(lock: &Arc<ContextLock>) -> Option<ArcContextLockWriteGuard> {
|
||||
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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user