File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -741,7 +741,7 @@ pub fn exit(ret: isize, context: &mut ProcessContext) {
741
741
x86_64 :: instructions :: interrupts :: without_interrupts (|| {
742
742
let manager = get_process_manager ();
743
743
// FIXME: implement this for ProcessManager
744
- manager . kill_self (ret );
744
+ manager . kill_current (ret );
745
745
manager . switch_next (context );
746
746
})
747
747
}
@@ -752,8 +752,8 @@ pub fn exit(ret: isize, context: &mut ProcessContext) {
752
752
退出的操作并不只用于当前进程,也可以作用于其他进程,因此可以通过如下方式将它们统一:
753
753
754
754
```rust
755
- pub fn kill_self (&self, ret: isize) {
756
- self.kill(processor::current_pid (), ret);
755
+ pub fn kill_current (&self, ret: isize) {
756
+ self.kill(processor::get_pid (), ret);
757
757
}
758
758
759
759
pub fn kill(&self, pid: ProcessId, ret: isize) {
Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ pub fn wait_pid(pid: ProcessId, context: &mut ProcessContext) {
419
419
pub fn wait_pid (& self , pid : ProcessId ) {
420
420
let mut wait_queue = self . wait_queue. lock ();
421
421
// FIXME: push the current process to the wait queue
422
- // `processor::current_pid ()` is waiting for `pid`
422
+ // `processor::get_pid ()` is waiting for `pid`
423
423
}
424
424
```
425
425
@@ -726,7 +726,7 @@ pub struct ProcessData {
726
726
pub fn sem_wait (key : u32 , context : & mut ProcessContext ) {
727
727
x86_64 :: instructions :: interrupts :: without_interrupts (|| {
728
728
let manager = get_process_manager ();
729
- let pid = processor :: current_pid ();
729
+ let pid = processor :: get_pid ();
730
730
let ret = manager . current (). write (). sem_wait (key , pid );
731
731
match ret {
732
732
SemaphoreResult :: Ok => context . set_rax (0 ),
You can’t perform that action at this time.
0 commit comments