File tree Expand file tree Collapse file tree 8 files changed +14
-65
lines changed Expand file tree Collapse file tree 8 files changed +14
-65
lines changed Original file line number Diff line number Diff line change 11use crate :: ffi:: OsString ;
2+ use crate :: fmt;
23
34pub struct Args { }
45
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -13,20 +13,10 @@ impl Thread {
1313 unsupported ( )
1414 }
1515
16- pub fn yield_now ( ) {
17- // do nothing
18- }
16+ pub fn yield_now ( ) { }
1917
20- pub fn set_name ( _name : & CStr ) {
21- // nope
22- }
18+ pub fn set_name ( _name : & CStr ) { }
2319
24- #[ cfg( not( target_feature = "atomics" ) ) ]
25- pub fn sleep ( _dur : Duration ) {
26- panic ! ( "can't sleep" ) ;
27- }
28-
29- #[ cfg( target_feature = "atomics" ) ]
3020 pub fn sleep ( dur : Duration ) {
3121 use crate :: arch:: wasm32;
3222 use crate :: cmp;
@@ -46,9 +36,7 @@ impl Thread {
4636 }
4737 }
4838
49- pub fn join ( self ) {
50- self . 0
51- }
39+ pub fn join ( self ) { }
5240}
5341
5442pub mod guard {
@@ -61,11 +49,9 @@ pub mod guard {
6149 }
6250}
6351
64- // This is only used by atomics primitives when the `atomics` feature is
65- // enabled. In that mode we currently just use our own thread-local to store our
52+ // We currently just use our own thread-local to store our
6653// current thread's ID, and then we lazily initialize it to something allocated
6754// from a global counter.
68- #[ cfg( target_feature = "atomics" ) ]
6955pub fn my_id ( ) -> u32 {
7056 use crate :: sync:: atomic:: { AtomicU32 , Ordering :: SeqCst } ;
7157
Original file line number Diff line number Diff line change 1717#![ deny( unsafe_op_in_unsafe_fn) ]
1818
1919pub mod alloc;
20+ #[ path = "../unsupported/args.rs" ]
2021pub mod args;
2122#[ path = "../unix/cmath.rs" ]
2223pub mod cmath;
@@ -37,7 +38,6 @@ pub mod pipe;
3738pub mod process;
3839#[ path = "../unsupported/stdio.rs" ]
3940pub mod stdio;
40- pub mod thread;
4141#[ path = "../unsupported/thread_local_dtor.rs" ]
4242pub mod thread_local_dtor;
4343#[ path = "../unsupported/thread_local_key.rs" ]
@@ -49,21 +49,25 @@ pub use crate::sys_common::os_str_bytes as os_str;
4949
5050cfg_if:: cfg_if! {
5151 if #[ cfg( target_feature = "atomics" ) ] {
52- #[ path = "condvar_atomics .rs" ]
52+ #[ path = "atomics/condvar .rs" ]
5353 pub mod condvar;
54- #[ path = "mutex_atomics .rs" ]
54+ #[ path = "atomics/mutex .rs" ]
5555 pub mod mutex;
56- #[ path = "rwlock_atomics .rs" ]
56+ #[ path = "atomics/rwlock .rs" ]
5757 pub mod rwlock;
58- #[ path = "futex_atomics .rs" ]
58+ #[ path = "atomics/futex .rs" ]
5959 pub mod futex;
60+ #[ path = "atomics/thread.rs" ]
61+ pub mod thread;
6062 } else {
6163 #[ path = "../unsupported/condvar.rs" ]
6264 pub mod condvar;
6365 #[ path = "../unsupported/mutex.rs" ]
6466 pub mod mutex;
6567 #[ path = "../unsupported/rwlock.rs" ]
6668 pub mod rwlock;
69+ #[ path = "../unsupported/thread.rs" ]
70+ pub mod thread;
6771 }
6872}
6973
You can’t perform that action at this time.
0 commit comments