Home
last modified time | relevance | path

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

123

/DragonOS/kernel/src/init/
H A Dmod.rs1 use crate::libs::rwlock::RwLock;
12 static BOOT_PARAMS: RwLock<BootParams> = RwLock::new(BootParams::new());
15 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/process/
H A Dmod.rs43 rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard},
618 thread_pid: Arc<RwLock<PidStrcut>>,
619 basic: RwLock<ProcessBasicInfo>,
626 kernel_stack: RwLock<KernelStack>,
629 syscall_stack: RwLock<KernelStack>,
636 sig_info: RwLock<ProcessSignalInfo>,
643 parent_pcb: RwLock<Weak<ProcessControlBlock>>,
645 real_parent_pcb: RwLock<Weak<ProcessControlBlock>>,
648 children: RwLock<Vec<Pid>>,
654 thread: RwLock<ThreadInfo>,
[all …]
/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/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>;
/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> { impl
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/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);
/DragonOS/kernel/src/bpf/prog/
H A Dverifier.rs8 use crate::libs::rwlock::RwLock;
36 fn relocation(&mut self, fd_table: &Arc<RwLock<FileDescriptorVec>>) -> Result<()> { in relocation()
127 pub fn verify(mut self, fd_table: &Arc<RwLock<FileDescriptorVec>>) -> Result<BpfProg> { in verify()
/DragonOS/kernel/src/namespaces/
H A Duser_namespace.rs5 use crate::libs::rwlock::RwLock;
51 pid: Arc<RwLock<Pid>>,
129 pid: Arc::new(RwLock::new(Pid::new(1))), in new()
H A Dpid_namespace.rs14 use crate::{libs::rwlock::RwLock, process::Pid};
31 id_alloctor: RwLock<IdAllocator>,
43 child_reaper: Arc<RwLock<Pid>>,
216 id_alloctor: RwLock::new(IdAllocator::new(1, PID_MAX).unwrap()), in new()
219 child_reaper: Arc::new(RwLock::new(Pid::from(1))), in new()
250 id_alloctor: RwLock::new(IdAllocator::new(1, PID_MAX).unwrap()), in create_pid_namespace()
/DragonOS/kernel/src/driver/video/
H A Dmod.rs9 rwlock::{RwLock, RwLockReadGuard},
38 device_buffer: RwLock<ScmBufferInfo>,
39 refresh_target: RwLock<Option<Arc<SpinLock<Box<[u8]>>>>>,
211 device_buffer: RwLock::new(device_buffer), in video_init()
212 refresh_target: RwLock::new(None), in video_init()
/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/tty/
H A Dtty_core.rs16 rwlock::{RwLock, RwLockReadGuard, RwLockUpgradableGuard, RwLockWriteGuard},
61 termios: RwLock::new(termios), in new()
63 flags: RwLock::new(TtyFlag::empty()), in new()
65 window_size: RwLock::new(WindowSize::default()), in new()
68 port: RwLock::new(None), in new()
74 link: RwLock::default(), in new()
304 termios: RwLock<Termios>,
306 flags: RwLock<TtyFlag>,
312 window_size: RwLock<WindowSize>,
318 port: RwLock<Option<Arc<dyn TtyPort>>>,
[all …]
/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/debug/kprobe/
H A Dmod.rs2 use crate::libs::rwlock::RwLock;
14 pub type LockKprobe = Arc<RwLock<Kprobe>>;
167 let kprobe = Arc::new(RwLock::new(kprobe)); in register_kprobe()
/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()

123