@@ -4,7 +4,7 @@ cfg_select! {
44 pub use hermit:: { Thread , available_parallelism, sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
55 #[ expect( dead_code) ]
66 mod unsupported;
7- pub use unsupported:: { current_os_id, set_name } ;
7+ pub use unsupported:: current_os_id;
88 }
99 all( target_vendor = "fortanix" , target_env = "sgx" ) => {
1010 mod sgx;
@@ -21,41 +21,32 @@ cfg_select! {
2121 // as-is with the SGX target.
2222 #[ expect( dead_code) ]
2323 mod unsupported;
24- pub use unsupported:: { available_parallelism, set_name } ;
24+ pub use unsupported:: available_parallelism;
2525 }
2626 target_os = "solid_asp3" => {
2727 mod solid;
2828 pub use solid:: { Thread , sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
2929 #[ expect( dead_code) ]
3030 mod unsupported;
31- pub use unsupported:: { available_parallelism, current_os_id, set_name } ;
31+ pub use unsupported:: { available_parallelism, current_os_id} ;
3232 }
3333 target_os = "teeos" => {
3434 mod teeos;
3535 pub use teeos:: { Thread , sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
3636 #[ expect( dead_code) ]
3737 mod unsupported;
38- pub use unsupported:: { available_parallelism, current_os_id, set_name } ;
38+ pub use unsupported:: { available_parallelism, current_os_id} ;
3939 }
4040 target_os = "uefi" => {
4141 mod uefi;
4242 pub use uefi:: { available_parallelism, sleep} ;
4343 #[ expect( dead_code) ]
4444 mod unsupported;
45- pub use unsupported:: { Thread , current_os_id, set_name , yield_now, DEFAULT_MIN_STACK_SIZE } ;
45+ pub use unsupported:: { Thread , current_os_id, yield_now, DEFAULT_MIN_STACK_SIZE } ;
4646 }
4747 target_family = "unix" => {
4848 mod unix;
4949 pub use unix:: { Thread , available_parallelism, current_os_id, sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
50- #[ cfg( not( any(
51- target_env = "newlib" ,
52- target_os = "l4re" ,
53- target_os = "emscripten" ,
54- target_os = "redox" ,
55- target_os = "hurd" ,
56- target_os = "aix" ,
57- ) ) ) ]
58- pub use unix:: set_name;
5950 #[ cfg( any(
6051 target_os = "freebsd" ,
6152 target_os = "netbsd" ,
@@ -69,17 +60,8 @@ cfg_select! {
6960 target_os = "vxworks" ,
7061 ) ) ]
7162 pub use unix:: sleep_until;
72- #[ expect( dead_code) ]
73- mod unsupported;
74- #[ cfg( any(
75- target_env = "newlib" ,
76- target_os = "l4re" ,
77- target_os = "emscripten" ,
78- target_os = "redox" ,
79- target_os = "hurd" ,
80- target_os = "aix" ,
81- ) ) ]
82- pub use unsupported:: set_name;
63+ // This is used to name the main thread in the platform init function.
64+ pub ( super ) use unix:: set_name;
8365 }
8466 all( target_os = "wasi" , target_env = "p1" ) => {
8567 mod wasip1;
@@ -88,7 +70,7 @@ cfg_select! {
8870 pub use wasip1:: { Thread , available_parallelism} ;
8971 #[ expect( dead_code) ]
9072 mod unsupported;
91- pub use unsupported:: { current_os_id, set_name } ;
73+ pub use unsupported:: current_os_id;
9274 #[ cfg( not( target_feature = "atomics" ) ) ]
9375 pub use unsupported:: { Thread , available_parallelism} ;
9476 }
@@ -100,31 +82,31 @@ cfg_select! {
10082 // Note that unlike WASIp1 even if the wasm `atomics` feature is enabled
10183 // there is no support for threads, not even experimentally, not even in
10284 // wasi-libc. Thus this is unconditionally unsupported.
103- pub use unsupported:: { Thread , available_parallelism, current_os_id, set_name , yield_now, DEFAULT_MIN_STACK_SIZE } ;
85+ pub use unsupported:: { Thread , available_parallelism, current_os_id, yield_now, DEFAULT_MIN_STACK_SIZE } ;
10486 }
10587 all( target_family = "wasm" , target_feature = "atomics" ) => {
10688 mod wasm;
10789 pub use wasm:: sleep;
10890
10991 #[ expect( dead_code) ]
11092 mod unsupported;
111- pub use unsupported:: { Thread , available_parallelism, current_os_id, set_name , yield_now, DEFAULT_MIN_STACK_SIZE } ;
93+ pub use unsupported:: { Thread , available_parallelism, current_os_id, yield_now, DEFAULT_MIN_STACK_SIZE } ;
11294 }
11395 target_os = "windows" => {
11496 mod windows;
115- pub use windows:: { Thread , available_parallelism, current_os_id, set_name , set_name_wide, sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
97+ pub use windows:: { Thread , available_parallelism, current_os_id, set_name_wide, sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
11698 }
11799 target_os = "xous" => {
118100 mod xous;
119101 pub use xous:: { Thread , available_parallelism, sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
120102
121103 #[ expect( dead_code) ]
122104 mod unsupported;
123- pub use unsupported:: { current_os_id, set_name } ;
105+ pub use unsupported:: current_os_id;
124106 }
125107 _ => {
126108 mod unsupported;
127- pub use unsupported:: { Thread , available_parallelism, current_os_id, set_name , sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
109+ pub use unsupported:: { Thread , available_parallelism, current_os_id, sleep, yield_now, DEFAULT_MIN_STACK_SIZE } ;
128110 }
129111}
130112
0 commit comments