Home
last modified time | relevance | path

Searched refs:RwLock (Results 1 – 25 of 57) sorted by relevance

123

/DragonOS/kernel/src/init/
H A Dmod.rs1 use crate::libs::rwlock::RwLock;
11 static BOOT_PARAMS: RwLock<BootParams> = RwLock::new(BootParams::new());
14 pub fn boot_params() -> &'static RwLock<BootParams> { in boot_params()
/DragonOS/tools/debugging/logmonitor/src/constant/
H A Dmod.rs1 use std::sync::RwLock;
6 pub static CMD_ARGS: RwLock<Option<CommandLineArgs>> = RwLock::new(None);
/DragonOS/docs/kernel/locking/
H A Drwlock.md1 # RwLock读写锁
16 …的一致性. 数据会被包裹在一个RwLock的数据结构中, 一切的访问必须通过RwLock的数据结构进行访问和修改. 每个要访问共享数据的会获得一个守卫(guard), 只读进程获得READER(读…
27 #### 2.3.1 RwLock数据结构
29 pub struct RwLock<T> {
46 inner: &'a RwLock<T>,
54 inner: &'a RwLock<T>,
58 #### 2.3.5 RwLock的lock的结构介绍
79 ### 3.1 RwLock的主要API
81 ///功能: 输入需要保护的数据类型data,返回一个新的RwLock类型.
129 static LOCK: RwLock<u32> = RwLock::new(100 as u32);
/DragonOS/kernel/src/driver/pci/test/
H A Dpt_driver.rs21 libs::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
26 driver_data: RwLock<DriverCommonData>,
27 kobj_data: RwLock<KObjectCommonData>,
29 pub locked_dynid_list: RwLock<Vec<Arc<PciDeviceID>>>,
38 driver_data: RwLock::new(DriverCommonData::default()), in new()
39 kobj_data: RwLock::new(KObjectCommonData::default()), in new()
41 locked_dynid_list: RwLock::new(vec![]), in new()
H A Dpt_device.rs26 libs::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
36 device_data: RwLock<DeviceCommonData>,
37 kobj_data: RwLock<KObjectCommonData>,
43 let common_dev = RwLock::new(DeviceCommonData::default()); in new()
44 let common_kobj = RwLock::new(KObjectCommonData::default()); in new()
/DragonOS/kernel/src/process/
H A Dmod.rs43 rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
612 basic: RwLock<ProcessBasicInfo>,
619 kernel_stack: RwLock<KernelStack>,
622 syscall_stack: RwLock<KernelStack>,
629 sig_info: RwLock<ProcessSignalInfo>,
636 parent_pcb: RwLock<Weak<ProcessControlBlock>>,
638 real_parent_pcb: RwLock<Weak<ProcessControlBlock>>,
641 children: RwLock<Vec<Pid>>,
647 thread: RwLock<ThreadInfo>,
653 robust_list: RwLock<Option<RobustListHead>>,
[all …]
/DragonOS/kernel/src/driver/base/
H A Dkset.rs14 libs::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
21 kobjects: RwLock<Vec<Weak<dyn KObject>>>,
23 inner: RwLock<InnerKSet>,
27 parent_data: RwLock<KSetParentData>,
49 kobjects: RwLock::new(Vec::new()), in new()
50 inner: RwLock::new(InnerKSet::new(name)), in new()
52 parent_data: RwLock::new(KSetParentData::new(None, None)), in new()
H A Dsubsys.rs8 rwlock::{RwLock, RwLockReadGuard},
34 ksets: RwLock<SubSysKSets>,
41 devices: RwLock<Vec<Arc<dyn Device>>>,
43 drivers: RwLock<Vec<Arc<dyn Driver>>>,
75 ksets: RwLock::new(SubSysKSets::new()), in new()
79 devices: RwLock::new(Vec::new()), in new()
80 drivers: RwLock::new(Vec::new()), in new()
H A Dkobject.rs18 rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
111 pub struct LockedKObjectState(RwLock<KObjectState>);
116 LockedKObjectState(RwLock::new(state)) in new()
121 type Target = RwLock<KObjectState>;
H A Dcpu.rs11 libs::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
111 inner: RwLock<InnerCpuSubSystemFakeRootDevice>,
118 inner: RwLock::new(InnerCpuSubSystemFakeRootDevice::new()), in new()
/DragonOS/kernel/src/libs/
H A Drwlock.rs38 pub struct RwLock<T> { struct
57 inner: &'a RwLock<T>, argument
66 inner: &'a RwLock<T>,
70 unsafe impl<T: Send> Send for RwLock<T> {} implementation
71 unsafe impl<T: Send + Sync> Sync for RwLock<T> {} implementation
74 impl<T> RwLock<T> { implementation
78 return RwLock { in new()
88 let RwLock { data, .. } = self; in into_inner() localVariable
381 impl<T: Default> Default for RwLock<T> { implementation
388 impl<T> From<T> for RwLock<T> { implementation
[all …]
H A Dnotifier.rs4 use crate::libs::{rwlock::RwLock, spinlock::SpinLock};
151 pub struct BlockingNotifierChain<V: Clone + Copy, T>(RwLock<NotifierChain<V, T>>);
155 Self(RwLock::new(NotifierChain::<V, T>::new())) in new()
/DragonOS/kernel/src/driver/firmware/efi/
H A Dmod.rs5 libs::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
25 inner: RwLock<InnerEFIManager>,
54 inner: RwLock::new(InnerEFIManager { in new()
/DragonOS/kernel/src/driver/virtio/
H A Dirq.rs14 libs::rwlock::RwLock,
27 map: RwLock<HashMap<Arc<DeviceId>, Arc<dyn VirtIODevice>>>,
33 map: RwLock::new(HashMap::new()), in new()
/DragonOS/kernel/src/driver/video/
H A Dmod.rs9 rwlock::{RwLock, RwLockReadGuard},
34 device_buffer: RwLock<ScmBufferInfo>,
35 refresh_target: RwLock<Option<Arc<SpinLock<Box<[u8]>>>>>,
202 device_buffer: RwLock::new(device_buffer), in video_init()
203 refresh_target: RwLock::new(None), in video_init()
/DragonOS/kernel/src/driver/tty/
H A Dtty_core.rs16 rwlock::{RwLock, RwLockReadGuard, RwLockUpgradableGuard, RwLockWriteGuard},
58 termios: RwLock::new(termios), in new()
60 flags: RwLock::new(TtyFlag::empty()), in new()
62 window_size: RwLock::new(WindowSize::default()), in new()
65 port: RwLock::new(None), in new()
70 link: RwLock::default(), in new()
290 termios: RwLock<Termios>,
292 flags: RwLock<TtyFlag>,
297 window_size: RwLock<WindowSize>,
303 port: RwLock<Option<Arc<dyn TtyPort>>>,
[all …]
/DragonOS/tools/debugging/logmonitor/src/backend/
H A Dmod.rs3 sync::{mpsc, Arc, Mutex, RwLock, Weak},
21 main_thread: RwLock<Option<std::thread::JoinHandle<()>>>,
32 main_thread: RwLock::new(None), in new()
/DragonOS/kernel/src/driver/rtc/
H A Dmod.rs7 libs::rwlock::RwLock,
22 static GLOBAL_DEFAULT_RTC: RwLock<Option<Arc<RtcGeneralDevice>>> = RwLock::new(None);
H A Drtc_cmos.rs32 rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
37 static CMOS_RTC_GENERAL_DEVICE: RwLock<Option<Arc<RtcGeneralDevice>>> = RwLock::new(None);
/DragonOS/kernel/src/net/
H A Dmod.rs8 use crate::{driver::net::NetDevice, libs::rwlock::RwLock};
21 …pub static ref NET_DEVICES: RwLock<BTreeMap<usize, Arc<dyn NetDevice>>> = RwLock::new(BTreeMap::ne…
/DragonOS/kernel/src/driver/block/cache/
H A Dcached_block_device.rs5 use crate::{driver::base::block::block_device::BlockId, libs::rwlock::RwLock};
195 struct LockedCacheSpace(RwLock<CacheSpace>);
199 LockedCacheSpace(RwLock::new(space)) in new()
309 lock: RwLock<CacheMapper>,
315 lock: RwLock::new(inner), in new()
/DragonOS/kernel/src/driver/pci/
H A Draw_device.rs16 libs::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
27 inner: RwLock<InnerPciGeneralDevice>,
49 inner: RwLock::new(InnerPciGeneralDevice { in from()
/DragonOS/kernel/src/filesystem/kernfs/
H A Dmod.rs16 rwlock::RwLock,
105 inner: RwLock::new(InnerKernFSInode { in create_root_inode()
112 fs: RwLock::new(Weak::new()), in create_root_inode()
125 inner: RwLock<InnerKernFSInode>,
127 fs: RwLock<Weak<KernFS>>,
401 inner: RwLock::new(InnerKernFSInode { in new()
408 fs: RwLock::new(Weak::new()), in new()
/DragonOS/kernel/src/driver/open_firmware/
H A Dfdt.rs12 libs::rwlock::RwLock,
23 static FDT_GLOBAL_DATA: RwLock<FdtGlobalData> = RwLock::new(FdtGlobalData::new());
48 inner: RwLock<InnerOpenFirmwareFdtDriver>,
60 inner: RwLock::new(InnerOpenFirmwareFdtDriver { in new()
/DragonOS/kernel/src/driver/keyboard/
H A Dps2_keyboard.rs32 rwlock::RwLock,
56 pub struct LockedPS2KeyBoardInode(RwLock<PS2KeyBoardInode>);
98 let result = Arc::new(LockedPS2KeyBoardInode(RwLock::new(inode))); in new()

123