From 3130538fc5591d05220c95326668f46e3c03413a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20da=20Silva=20Yokomizo?= Date: Tue, 28 May 2024 11:25:54 +0200 Subject: [PATCH] Force `tid` wrapper to move This patch is related to 517326b, which aims to fix the compilation on musl. --- glommio/src/executor/stall.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/glommio/src/executor/stall.rs b/glommio/src/executor/stall.rs index cef4a2a04..18a332c28 100644 --- a/glommio/src/executor/stall.rs +++ b/glommio/src/executor/stall.rs @@ -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(