Skip to content

Commit

Permalink
Force tid wrapper to move
Browse files Browse the repository at this point in the history
This patch is related to 517326b, which aims to fix the compilation on
musl.
  • Loading branch information
yokomizor committed May 28, 2024
1 parent c373d35 commit 3130538
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions glommio/src/executor/stall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,15 @@ impl StallDetector {
struct SendWrapper(libc::pthread_t);
unsafe impl Send for SendWrapper {}
let tid = SendWrapper(unsafe { nix::libc::pthread_self() });
std::thread::spawn(enclose::enclose! { (terminated, timer) move || {
std::thread::spawn(move || {
let tid = tid;
while timer.wait().is_ok() {
if terminated.load(Ordering::Relaxed) {
return
return;
}
unsafe { nix::libc::pthread_kill(tid.0, signal) };
}
}})
})
}

pub(crate) fn enter_task_queue(
Expand Down

0 comments on commit 3130538

Please sign in to comment.