File tree Expand file tree Collapse file tree 15 files changed +58
-32
lines changed
Expand file tree Collapse file tree 15 files changed +58
-32
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,12 @@ pub mod alloc;
2222pub mod args;
2323#[ path = "../unix/cmath.rs" ]
2424pub mod cmath;
25- pub mod condvar;
2625pub mod env;
2726pub mod fd;
2827pub mod fs;
2928#[ path = "../unsupported/io.rs" ]
3029pub mod io;
3130pub mod memchr;
32- pub mod mutex;
3331pub mod net;
3432pub mod os;
3533#[ path = "../unix/os_str.rs" ]
@@ -40,14 +38,23 @@ pub mod path;
4038pub mod pipe;
4139#[ path = "../unsupported/process.rs" ]
4240pub mod process;
43- pub mod rwlock;
4441pub mod stdio;
4542pub mod thread;
4643pub mod thread_local_dtor;
4744#[ path = "../unsupported/thread_local_key.rs" ]
4845pub mod thread_local_key;
4946pub mod time;
5047
48+ mod condvar;
49+ mod mutex;
50+ mod rwlock;
51+
52+ pub mod locks {
53+ pub use super :: condvar:: * ;
54+ pub use super :: mutex:: * ;
55+ pub use super :: rwlock:: * ;
56+ }
57+
5158use crate :: io:: ErrorKind ;
5259
5360#[ allow( unused_extern_crates) ]
Original file line number Diff line number Diff line change @@ -15,15 +15,13 @@ pub mod alloc;
1515pub mod args;
1616#[ path = "../unix/cmath.rs" ]
1717pub mod cmath;
18- pub mod condvar;
1918pub mod env;
2019pub mod fd;
2120#[ path = "../unsupported/fs.rs" ]
2221pub mod fs;
2322#[ path = "../unsupported/io.rs" ]
2423pub mod io;
2524pub mod memchr;
26- pub mod mutex;
2725pub mod net;
2826pub mod os;
2927#[ path = "../unix/os_str.rs" ]
@@ -33,12 +31,21 @@ pub mod path;
3331pub mod pipe;
3432#[ path = "../unsupported/process.rs" ]
3533pub mod process;
36- pub mod rwlock;
3734pub mod stdio;
3835pub mod thread;
3936pub mod thread_local_key;
4037pub mod time;
4138
39+ mod condvar;
40+ mod mutex;
41+ mod rwlock;
42+
43+ pub mod locks {
44+ pub use super :: condvar:: * ;
45+ pub use super :: mutex:: * ;
46+ pub use super :: rwlock:: * ;
47+ }
48+
4249// SAFETY: must be called only once during runtime initialization.
4350// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
4451pub unsafe fn init ( argc : isize , argv : * const * const u8 ) {
Original file line number Diff line number Diff line change @@ -37,14 +37,21 @@ pub mod path;
3737pub mod pipe;
3838#[ path = "../unsupported/process.rs" ]
3939pub mod process;
40- pub mod rwlock;
4140pub mod stdio;
42- pub use self :: itron:: { condvar , mutex , thread} ;
41+ pub use self :: itron:: thread;
4342pub mod memchr;
4443pub mod thread_local_dtor;
4544pub mod thread_local_key;
4645pub mod time;
4746
47+ mod rwlock;
48+
49+ pub mod locks {
50+ pub use super :: itron:: condvar:: * ;
51+ pub use super :: itron:: mutex:: * ;
52+ pub use super :: rwlock:: * ;
53+ }
54+
4855// SAFETY: must be called only once during runtime initialization.
4956// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
5057pub unsafe fn init ( _argc : isize , _argv : * const * const u8 ) { }
Original file line number Diff line number Diff line change 1- use crate :: sys:: mutex :: Mutex ;
1+ use crate :: sys:: locks :: Mutex ;
22use crate :: time:: Duration ;
33
44pub struct Condvar { }
Original file line number Diff line number Diff line change 1+ mod condvar;
2+ mod mutex;
3+ mod rwlock;
4+ pub use condvar:: { Condvar , MovableCondvar } ;
5+ pub use mutex:: { MovableMutex , Mutex , ReentrantMutex } ;
6+ pub use rwlock:: { MovableRWLock , RWLock } ;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,11 +4,10 @@ pub mod alloc;
44pub mod args;
55#[ path = "../unix/cmath.rs" ]
66pub mod cmath;
7- pub mod condvar;
87pub mod env;
98pub mod fs;
109pub mod io;
11- pub mod mutex ;
10+ pub mod locks ;
1211pub mod net;
1312pub mod os;
1413#[ path = "../unix/os_str.rs" ]
@@ -17,7 +16,6 @@ pub mod os_str;
1716pub mod path;
1817pub mod pipe;
1918pub mod process;
20- pub mod rwlock;
2119pub mod stdio;
2220pub mod thread;
2321#[ cfg( target_thread_local) ]
Original file line number Diff line number Diff line change @@ -22,14 +22,12 @@ pub mod alloc;
2222pub mod args;
2323#[ path = "../unix/cmath.rs" ]
2424pub mod cmath;
25- #[ path = "../unsupported/condvar.rs" ]
26- pub mod condvar;
2725pub mod env;
2826pub mod fd;
2927pub mod fs;
3028pub mod io;
31- #[ path = "../unsupported/mutex .rs" ]
32- pub mod mutex ;
29+ #[ path = "../unsupported/locks/mod .rs" ]
30+ pub mod locks ;
3331pub mod net;
3432pub mod os;
3533#[ path = "../unix/os_str.rs" ]
@@ -40,8 +38,6 @@ pub mod path;
4038pub mod pipe;
4139#[ path = "../unsupported/process.rs" ]
4240pub mod process;
43- #[ path = "../unsupported/rwlock.rs" ]
44- pub mod rwlock;
4541pub mod stdio;
4642pub mod thread;
4743#[ path = "../unsupported/thread_local_dtor.rs" ]
Original file line number Diff line number Diff line change @@ -50,22 +50,23 @@ pub mod time;
5050cfg_if:: cfg_if! {
5151 if #[ cfg( target_feature = "atomics" ) ] {
5252 #[ path = "atomics/condvar.rs" ]
53- pub mod condvar;
53+ mod condvar;
5454 #[ path = "atomics/mutex.rs" ]
55- pub mod mutex;
55+ mod mutex;
5656 #[ path = "atomics/rwlock.rs" ]
57- pub mod rwlock;
57+ mod rwlock;
58+ pub mod locks {
59+ pub use super :: condvar:: * ;
60+ pub use super :: mutex:: * ;
61+ pub use super :: rwlock:: * ;
62+ }
5863 #[ path = "atomics/futex.rs" ]
5964 pub mod futex;
6065 #[ path = "atomics/thread.rs" ]
6166 pub mod thread;
6267 } else {
63- #[ path = "../unsupported/condvar.rs" ]
64- pub mod condvar;
65- #[ path = "../unsupported/mutex.rs" ]
66- pub mod mutex;
67- #[ path = "../unsupported/rwlock.rs" ]
68- pub mod rwlock;
68+ #[ path = "../unsupported/locks/mod.rs" ]
69+ pub mod locks;
6970 #[ path = "../unsupported/thread.rs" ]
7071 pub mod thread;
7172 }
You can’t perform that action at this time.
0 commit comments