replaced spin::Mutex with sync::SpinLock, now spinlock works well.

master
maoyuchaxue 6 years ago
parent 6df13c57ca
commit f27fd37d82

@ -1,7 +1,7 @@
use consts::KERNEL_OFFSET;
use core::ptr::Unique;
use core::fmt;
use spin::Mutex;
use sync::SpinLock as Mutex;
use volatile::Volatile;
use x86_64::instructions::port::Port;
use logging::Color;

@ -2,7 +2,7 @@ use simple_filesystem::*;
use alloc::boxed::Box;
#[cfg(target_arch = "x86_64")]
use arch::driver::ide;
use spin::Mutex;
use sync::SpinLock as Mutex;
// Hard link user program
#[cfg(target_arch = "riscv32")]

@ -1,7 +1,8 @@
pub use arch::paging::*;
use bit_allocator::{BitAlloc, BitAlloc4K, BitAlloc64K};
use consts::MEMORY_OFFSET;
use spin::{Mutex, MutexGuard};
use sync::{MutexGuard, Spin};
use sync::SpinLock as Mutex;
use super::HEAP_ALLOCATOR;
use ucore_memory::{*, paging::PageTable};
use ucore_memory::cow::CowExt;
@ -48,7 +49,7 @@ lazy_static! {
}
/// The only way to get active page table
pub fn active_table() -> MutexGuard<'static, CowExt<ActivePageTable>> {
pub fn active_table() -> MutexGuard<'static, CowExt<ActivePageTable>, Spin> {
ACTIVE_TABLE.lock()
}

Loading…
Cancel
Save