File tree 15 files changed +58
-32
lines changed
15 files changed +58
-32
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,12 @@ pub mod alloc;
22
22
pub mod args;
23
23
#[ path = "../unix/cmath.rs" ]
24
24
pub mod cmath;
25
- pub mod condvar;
26
25
pub mod env;
27
26
pub mod fd;
28
27
pub mod fs;
29
28
#[ path = "../unsupported/io.rs" ]
30
29
pub mod io;
31
30
pub mod memchr;
32
- pub mod mutex;
33
31
pub mod net;
34
32
pub mod os;
35
33
#[ path = "../unix/os_str.rs" ]
@@ -40,14 +38,23 @@ pub mod path;
40
38
pub mod pipe;
41
39
#[ path = "../unsupported/process.rs" ]
42
40
pub mod process;
43
- pub mod rwlock;
44
41
pub mod stdio;
45
42
pub mod thread;
46
43
pub mod thread_local_dtor;
47
44
#[ path = "../unsupported/thread_local_key.rs" ]
48
45
pub mod thread_local_key;
49
46
pub mod time;
50
47
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
+
51
58
use crate :: io:: ErrorKind ;
52
59
53
60
#[ allow( unused_extern_crates) ]
Original file line number Diff line number Diff line change @@ -15,15 +15,13 @@ pub mod alloc;
15
15
pub mod args;
16
16
#[ path = "../unix/cmath.rs" ]
17
17
pub mod cmath;
18
- pub mod condvar;
19
18
pub mod env;
20
19
pub mod fd;
21
20
#[ path = "../unsupported/fs.rs" ]
22
21
pub mod fs;
23
22
#[ path = "../unsupported/io.rs" ]
24
23
pub mod io;
25
24
pub mod memchr;
26
- pub mod mutex;
27
25
pub mod net;
28
26
pub mod os;
29
27
#[ path = "../unix/os_str.rs" ]
@@ -33,12 +31,21 @@ pub mod path;
33
31
pub mod pipe;
34
32
#[ path = "../unsupported/process.rs" ]
35
33
pub mod process;
36
- pub mod rwlock;
37
34
pub mod stdio;
38
35
pub mod thread;
39
36
pub mod thread_local_key;
40
37
pub mod time;
41
38
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
+
42
49
// SAFETY: must be called only once during runtime initialization.
43
50
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
44
51
pub 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;
37
37
pub mod pipe;
38
38
#[ path = "../unsupported/process.rs" ]
39
39
pub mod process;
40
- pub mod rwlock;
41
40
pub mod stdio;
42
- pub use self :: itron:: { condvar , mutex , thread} ;
41
+ pub use self :: itron:: thread;
43
42
pub mod memchr;
44
43
pub mod thread_local_dtor;
45
44
pub mod thread_local_key;
46
45
pub mod time;
47
46
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
+
48
55
// SAFETY: must be called only once during runtime initialization.
49
56
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
50
57
pub 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 ;
2
2
use crate :: time:: Duration ;
3
3
4
4
pub 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;
4
4
pub mod args;
5
5
#[ path = "../unix/cmath.rs" ]
6
6
pub mod cmath;
7
- pub mod condvar;
8
7
pub mod env;
9
8
pub mod fs;
10
9
pub mod io;
11
- pub mod mutex ;
10
+ pub mod locks ;
12
11
pub mod net;
13
12
pub mod os;
14
13
#[ path = "../unix/os_str.rs" ]
@@ -17,7 +16,6 @@ pub mod os_str;
17
16
pub mod path;
18
17
pub mod pipe;
19
18
pub mod process;
20
- pub mod rwlock;
21
19
pub mod stdio;
22
20
pub mod thread;
23
21
#[ cfg( target_thread_local) ]
Original file line number Diff line number Diff line change @@ -22,14 +22,12 @@ pub mod alloc;
22
22
pub mod args;
23
23
#[ path = "../unix/cmath.rs" ]
24
24
pub mod cmath;
25
- #[ path = "../unsupported/condvar.rs" ]
26
- pub mod condvar;
27
25
pub mod env;
28
26
pub mod fd;
29
27
pub mod fs;
30
28
pub mod io;
31
- #[ path = "../unsupported/mutex .rs" ]
32
- pub mod mutex ;
29
+ #[ path = "../unsupported/locks/mod .rs" ]
30
+ pub mod locks ;
33
31
pub mod net;
34
32
pub mod os;
35
33
#[ path = "../unix/os_str.rs" ]
@@ -40,8 +38,6 @@ pub mod path;
40
38
pub mod pipe;
41
39
#[ path = "../unsupported/process.rs" ]
42
40
pub mod process;
43
- #[ path = "../unsupported/rwlock.rs" ]
44
- pub mod rwlock;
45
41
pub mod stdio;
46
42
pub mod thread;
47
43
#[ path = "../unsupported/thread_local_dtor.rs" ]
Original file line number Diff line number Diff line change @@ -50,22 +50,23 @@ pub mod time;
50
50
cfg_if:: cfg_if! {
51
51
if #[ cfg( target_feature = "atomics" ) ] {
52
52
#[ path = "atomics/condvar.rs" ]
53
- pub mod condvar;
53
+ mod condvar;
54
54
#[ path = "atomics/mutex.rs" ]
55
- pub mod mutex;
55
+ mod mutex;
56
56
#[ 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
+ }
58
63
#[ path = "atomics/futex.rs" ]
59
64
pub mod futex;
60
65
#[ path = "atomics/thread.rs" ]
61
66
pub mod thread;
62
67
} 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;
69
70
#[ path = "../unsupported/thread.rs" ]
70
71
pub mod thread;
71
72
}
Original file line number Diff line number Diff line change 1
1
use crate :: cell:: UnsafeCell ;
2
2
use crate :: sys:: c;
3
- use crate :: sys:: mutex :: { self , Mutex } ;
3
+ use crate :: sys:: locks :: { mutex , Mutex } ;
4
4
use crate :: sys:: os;
5
5
use crate :: time:: Duration ;
6
6
@@ -31,7 +31,7 @@ impl Condvar {
31
31
let r = c:: SleepConditionVariableSRW (
32
32
self . inner . get ( ) ,
33
33
mutex:: raw ( mutex) ,
34
- super :: dur2timeout ( dur) ,
34
+ crate :: sys :: windows :: dur2timeout ( dur) ,
35
35
0 ,
36
36
) ;
37
37
if r == 0 {
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 @@ -16,21 +16,19 @@ pub mod alloc;
16
16
pub mod args;
17
17
pub mod c;
18
18
pub mod cmath;
19
- pub mod condvar;
20
19
pub mod env;
21
20
pub mod fs;
22
21
pub mod handle;
23
22
pub mod io;
23
+ pub mod locks;
24
24
pub mod memchr;
25
- pub mod mutex;
26
25
pub mod net;
27
26
pub mod os;
28
27
pub mod os_str;
29
28
pub mod path;
30
29
pub mod pipe;
31
30
pub mod process;
32
31
pub mod rand;
33
- pub mod rwlock;
34
32
pub mod thread;
35
33
pub mod thread_local_dtor;
36
34
pub mod thread_local_key;
You can’t perform that action at this time.
0 commit comments