mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-23 01:46:24 +04:00
Replace TCB.inner.block with TCB::acquire_inner_lock
This commit is contained in:
parent
f1e772a984
commit
fb8a24fbad
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user