struct MemoryPoolEntry {
pages: Vec<usize>,
envs: Vec<usize>,
reference: usize,
write_lock: AtomicUsize,
}Expand description
Memory Pool Entry. Contains the pages it shared and the envs attatched to it. The entry also contains a lock field.
Fields§
§pages: Vec<usize>List of page indexes shared by this pool.
envs: Vec<usize>List of envs bind to this pool.
reference: usizeThe reference count of this pool. Destroy the pool is the reference goes zero.
write_lock: AtomicUsizeWrite lock, store the env-id which locked it. Or zero means unlocked.
Implementations§
Source§impl MemoryPoolEntry
impl MemoryPoolEntry
Sourcefn deref(&mut self, envid: usize) -> Result<bool, KError>
fn deref(&mut self, envid: usize) -> Result<bool, KError>
Decrease the reference of the pool. If the reference is minused to
zero, an Ok(true) will be returned.
Sourcepub fn lock(&mut self, envid: usize) -> bool
pub fn lock(&mut self, envid: usize) -> bool
Try to lock the pool. If locked successfully, the return value is
true.