@@ -20,7 +20,7 @@ use core::mem::{align_of, offset_of, size_of};
2020use core:: ptr:: { copy_nonoverlapping, drop_in_place, null, null_mut, NonNull } ;
2121use core:: slice;
2222use core:: sync:: atomic:: Ordering :: SeqCst ;
23- use core:: sync:: atomic:: { AtomicI32 , AtomicPtr , AtomicU8 } ;
23+ use core:: sync:: atomic:: { AtomicI32 , AtomicPtr , AtomicU32 , AtomicU8 } ;
2424use linux_raw_sys:: elf:: * ;
2525use rustix:: io;
2626use rustix:: mm:: { mmap_anonymous, mprotect, MapFlags , MprotectFlags , ProtFlags } ;
@@ -457,7 +457,7 @@ unsafe fn initialize_tls(
457457 )
458458 . fill ( 0 ) ;
459459
460- let thread_id_ptr = ( * metadata) . thread . thread_id . as_ptr ( ) ;
460+ let thread_id_ptr = ( * metadata) . thread . thread_id . as_ptr ( ) . cast :: < i32 > ( ) ;
461461
462462 ( newtls, thread_id_ptr)
463463}
@@ -719,6 +719,13 @@ unsafe fn exit(return_value: Option<NonNull<c_void>>) -> ! {
719719 // no signals for the process are delivered to this thread.
720720 #[ cfg( feature = "signal" ) ]
721721 {
722+ #[ cfg( any( target_arch = "arm" , target_arch = "x86" ) ) ]
723+ let all = Sigset { sig : [ !0 , !0 ] } ;
724+ #[ cfg( any(
725+ target_arch = "aarch64" ,
726+ target_arch = "riscv64" ,
727+ target_arch = "x86_64"
728+ ) ) ]
722729 let all = Sigset { sig : [ !0 ] } ;
723730 sigprocmask ( How :: BLOCK , Some ( & all) ) . ok ( ) ;
724731 }
@@ -857,7 +864,7 @@ pub unsafe fn join(thread: Thread) -> Option<NonNull<c_void>> {
857864/// `thread` must point to a valid thread record that has not already been
858865/// detached or joined.
859866unsafe fn wait_for_exit ( thread : Thread ) {
860- use rustix:: thread:: { futex, FutexFlags , FutexOperation } ;
867+ use rustix:: thread:: futex;
861868
862869 // Check whether the thread has exited already; we set the
863870 // `CloneFlags::CHILD_CLEARTID` flag on the clone syscall, so we can test
@@ -869,14 +876,11 @@ unsafe fn wait_for_exit(thread: Thread) {
869876 // `FutexFlags::PRIVATE` because the wake comes from Linux
870877 // as arranged by the `CloneFlags::CHILD_CLEARTID` flag,
871878 // and Linux doesn't use the private flag for the wake.
872- match futex (
873- thread_id. as_ptr ( ) . cast :: < u32 > ( ) ,
874- FutexOperation :: Wait ,
875- FutexFlags :: empty ( ) ,
879+ match futex:: wait (
880+ AtomicU32 :: from_ptr ( thread_id. as_ptr ( ) . cast ( ) ) ,
881+ futex:: Flags :: empty ( ) ,
876882 id_value. as_raw_nonzero ( ) . get ( ) as u32 ,
877- null ( ) ,
878- null_mut ( ) ,
879- 0 ,
883+ None ,
880884 ) {
881885 Ok ( _) => break ,
882886 Err ( io:: Errno :: INTR ) => continue ,
0 commit comments