Workaround hang on pthread_create

This commit is contained in:
Jeremy Soller
2023-05-31 20:39:58 -06:00
parent 3f13a228ed
commit ffc53bf23b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ pub unsafe fn rlct_clone_impl(stack: *mut usize) -> Result<usize> {
// Unblock context.
syscall::kill(new_pid, SIGCONT)?;
let _ = syscall::waitpid(new_pid, &mut 0, syscall::WUNTRACED | syscall::WCONTINUED);
let _ = syscall::waitpid(new_pid, &mut 0, syscall::WUNTRACED | syscall::WCONTINUED | syscall::WNOHANG);
Ok(new_pid)
}
+1 -1
View File
@@ -671,7 +671,7 @@ fn fork_inner(initial_rsp: *mut usize) -> Result<usize> {
// context. This means that if pgid is changed (as it is in ion for example), the pgid message
// in syscall::exit() will not be inserted as the key comparator thinks they're equal as their
// PIDs are. So, we have to call this to clear the waitpid queue to prevent deadlocks.
let _ = syscall::waitpid(new_pid, &mut 0, syscall::WUNTRACED | syscall::WCONTINUED);
let _ = syscall::waitpid(new_pid, &mut 0, syscall::WUNTRACED | syscall::WCONTINUED | syscall::WNOHANG);
Ok(new_pid)
}