Fix build on alpine

musl libc::pthread_t is a pointer so we need to tell Rust it's safe to send
across threads.

Fixes #10195
This commit is contained in:
Johannes Altmanninger 2024-01-07 02:41:53 +01:00
parent 3e31de295a
commit 6a64ba6638

View file

@ -663,12 +663,12 @@ add_test!("test_expand_argument_list", || {
fn test_1_cancellation(src: &wstr) {
let filler = IoBufferfill::create().unwrap();
let delay = Duration::from_millis(500);
let thread = unsafe { libc::pthread_self() };
let thread = unsafe { libc::pthread_self() } as usize;
iothread_perform(move || {
// Wait a while and then SIGINT the main thread.
std::thread::sleep(delay);
unsafe {
libc::pthread_kill(thread, SIGINT);
libc::pthread_kill(thread as libc::pthread_t, SIGINT);
}
});
let mut io = IoChain::new();