Replace TCB.inner.block with TCB::acquire_inner_lock

This commit is contained in:
Yifan Wu 2021-02-11 10:26:52 +08:00
parent f1e772a984
commit fb8a24fbad

View File

@ -118,7 +118,7 @@ impl TaskControlBlock {
.ppn();
// **** hold current PCB lock
let mut inner = self.inner.lock();
let mut inner = self.acquire_inner_lock();
// substitute memory_set
inner.memory_set = memory_set;
// update trap_cx ppn
@ -140,7 +140,7 @@ impl TaskControlBlock {
}
pub fn fork(self: &Arc<TaskControlBlock>) -> Arc<TaskControlBlock> {
// ---- hold parent PCB lock
let mut parent_inner = self.inner.lock();
let mut parent_inner = self.acquire_inner_lock();
// copy user space(include trap context)
let memory_set = MemorySet::from_existed_user(
&parent_inner.memory_set