Use Mutex and RwLock in jinux-frame for jinux-std

This commit is contained in:
Chuandong Li
2023-08-19 17:26:02 +00:00
committed by Tate, Hongliang Tian
parent df7bd65e70
commit 6d101c5b6d
26 changed files with 54 additions and 32 deletions

View File

@ -3,9 +3,9 @@ use alloc::str;
use alloc::string::String;
use core::sync::atomic::{AtomicUsize, Ordering};
use core::time::Duration;
use jinux_frame::sync::{RwLock, RwLockWriteGuard};
use jinux_frame::vm::VmFrame;
use jinux_util::slot_vec::SlotVec;
use spin::{RwLock, RwLockWriteGuard};
use super::*;
use crate::fs::device::Device;

View File

@ -18,14 +18,11 @@ pub(crate) use core::ffi::CStr;
pub(crate) use core::fmt::Debug;
pub(crate) use int_to_c_enum::TryFromInt;
pub(crate) use jinux_frame::config::PAGE_SIZE;
// pub(crate) use jinux_frame::sync::{Mutex, MutexGuard};
pub(crate) use jinux_frame::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard};
pub(crate) use jinux_frame::sync::{SpinLock, SpinLockGuard};
pub(crate) use jinux_frame::sync::{Mutex, MutexGuard, RwLock, SpinLock, SpinLockGuard};
pub(crate) use jinux_frame::vm::Vaddr;
pub(crate) use jinux_frame::{print, println};
pub(crate) use log::{debug, error, info, trace, warn};
pub(crate) use pod::Pod;
pub(crate) use spin::{Mutex, MutexGuard};
/// return current process
#[macro_export]

View File

@ -1,7 +1,7 @@
use crate::prelude::*;
use core::ops::Range;
use jinux_frame::sync::Mutex;
use jinux_frame::vm::{VmFrame, VmFrameVec, VmIo, VmMapOptions, VmPerm, VmSpace};
use spin::Mutex;
use crate::vm::{
vmo::get_page_idx_range,