File tree 8 files changed +14
-65
lines changed
8 files changed +14
-65
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: ffi:: OsString ;
2
+ use crate :: fmt;
2
3
3
4
pub struct Args { }
4
5
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 {
13
13
unsupported ( )
14
14
}
15
15
16
- pub fn yield_now ( ) {
17
- // do nothing
18
- }
16
+ pub fn yield_now ( ) { }
19
17
20
- pub fn set_name ( _name : & CStr ) {
21
- // nope
22
- }
18
+ pub fn set_name ( _name : & CStr ) { }
23
19
24
- #[ cfg( not( target_feature = "atomics" ) ) ]
25
- pub fn sleep ( _dur : Duration ) {
26
- panic ! ( "can't sleep" ) ;
27
- }
28
-
29
- #[ cfg( target_feature = "atomics" ) ]
30
20
pub fn sleep ( dur : Duration ) {
31
21
use crate :: arch:: wasm32;
32
22
use crate :: cmp;
@@ -46,9 +36,7 @@ impl Thread {
46
36
}
47
37
}
48
38
49
- pub fn join ( self ) {
50
- self . 0
51
- }
39
+ pub fn join ( self ) { }
52
40
}
53
41
54
42
pub mod guard {
@@ -61,11 +49,9 @@ pub mod guard {
61
49
}
62
50
}
63
51
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
66
53
// current thread's ID, and then we lazily initialize it to something allocated
67
54
// from a global counter.
68
- #[ cfg( target_feature = "atomics" ) ]
69
55
pub fn my_id ( ) -> u32 {
70
56
use crate :: sync:: atomic:: { AtomicU32 , Ordering :: SeqCst } ;
71
57
Original file line number Diff line number Diff line change 17
17
#![ deny( unsafe_op_in_unsafe_fn) ]
18
18
19
19
pub mod alloc;
20
+ #[ path = "../unsupported/args.rs" ]
20
21
pub mod args;
21
22
#[ path = "../unix/cmath.rs" ]
22
23
pub mod cmath;
@@ -37,7 +38,6 @@ pub mod pipe;
37
38
pub mod process;
38
39
#[ path = "../unsupported/stdio.rs" ]
39
40
pub mod stdio;
40
- pub mod thread;
41
41
#[ path = "../unsupported/thread_local_dtor.rs" ]
42
42
pub mod thread_local_dtor;
43
43
#[ path = "../unsupported/thread_local_key.rs" ]
@@ -49,21 +49,25 @@ pub use crate::sys_common::os_str_bytes as os_str;
49
49
50
50
cfg_if:: cfg_if! {
51
51
if #[ cfg( target_feature = "atomics" ) ] {
52
- #[ path = "condvar_atomics .rs" ]
52
+ #[ path = "atomics/condvar .rs" ]
53
53
pub mod condvar;
54
- #[ path = "mutex_atomics .rs" ]
54
+ #[ path = "atomics/mutex .rs" ]
55
55
pub mod mutex;
56
- #[ path = "rwlock_atomics .rs" ]
56
+ #[ path = "atomics/rwlock .rs" ]
57
57
pub mod rwlock;
58
- #[ path = "futex_atomics .rs" ]
58
+ #[ path = "atomics/futex .rs" ]
59
59
pub mod futex;
60
+ #[ path = "atomics/thread.rs" ]
61
+ pub mod thread;
60
62
} else {
61
63
#[ path = "../unsupported/condvar.rs" ]
62
64
pub mod condvar;
63
65
#[ path = "../unsupported/mutex.rs" ]
64
66
pub mod mutex;
65
67
#[ path = "../unsupported/rwlock.rs" ]
66
68
pub mod rwlock;
69
+ #[ path = "../unsupported/thread.rs" ]
70
+ pub mod thread;
67
71
}
68
72
}
69
73
You can’t perform that action at this time.
0 commit comments