File tree Expand file tree Collapse file tree 2 files changed +8
-19
lines changed Expand file tree Collapse file tree 2 files changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ pub mod pipe;
37
37
pub mod process;
38
38
#[ path = "../unsupported/stdio.rs" ]
39
39
pub mod stdio;
40
- pub mod thread;
41
40
#[ path = "../unsupported/thread_local_dtor.rs" ]
42
41
pub mod thread_local_dtor;
43
42
#[ path = "../unsupported/thread_local_key.rs" ]
@@ -57,13 +56,17 @@ cfg_if::cfg_if! {
57
56
pub mod rwlock;
58
57
#[ path = "futex_atomics.rs" ]
59
58
pub mod futex;
59
+ #[ path = "thread_atomics.rs" ]
60
+ pub mod thread;
60
61
} else {
61
62
#[ path = "../unsupported/condvar.rs" ]
62
63
pub mod condvar;
63
64
#[ path = "../unsupported/mutex.rs" ]
64
65
pub mod mutex;
65
66
#[ path = "../unsupported/rwlock.rs" ]
66
67
pub mod rwlock;
68
+ #[ path = "../unsupported/thread.rs" ]
69
+ pub mod thread;
67
70
}
68
71
}
69
72
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
You can’t perform that action at this time.
0 commit comments