Workaround hang on pthread_create
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user