mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +00:00
Use builder pattern to refactor the process module
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
9ca64c281e
commit
f540345bfd
@ -1,4 +1,4 @@
|
||||
use crate::{prelude::*, process::posix_thread::posix_thread_ext::PosixThreadExt, thread::Thread};
|
||||
use crate::{prelude::*, process::posix_thread::PosixThreadExt, thread::Thread};
|
||||
|
||||
use super::SyscallReturn;
|
||||
|
||||
@ -8,7 +8,7 @@ pub fn sys_pause() -> Result<SyscallReturn> {
|
||||
// check sig_queue of current thread and process,
|
||||
// if there's any pending signal, break loop
|
||||
let posix_thread = current_thread.as_posix_thread().unwrap();
|
||||
if !posix_thread.sig_queues().lock().empty() || !current!().sig_queues().lock().empty() {
|
||||
if posix_thread.has_pending_signal() || current!().has_pending_signal() {
|
||||
break;
|
||||
}
|
||||
// there's no pending signal, yield execution
|
||||
|
Reference in New Issue
Block a user