Verified Commit c51aec1a authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Workaround waitpid deadlock by making ptrace state thread local

parent 7a8015eb
Pipeline #9830 failed with stages
in 18 seconds
......@@ -39,10 +39,17 @@ impl State {
}
}
static STATE: Once<State> = Once::new();
#[thread_local]
static mut STATE: Option<State> = None;
pub fn init_state() -> &'static State {
STATE.call_once(|| State::new())
// Safe due to STATE being thread_local
unsafe {
if STATE.is_none() {
STATE = Some(State::new())
}
STATE.as_ref().unwrap()
}
}
pub fn is_traceme(pid: pid_t) -> bool {
File::open(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment