26
26
//!
27
27
//! [`Barrier`]: std::sync::Barrier
28
28
29
+ /// The `sync` implementation is the default implementation of threads.
30
+ ///
31
+ /// It depends on the `atomic-wait` feature by default, enable the `std`
32
+ /// feature will change this.
33
+ ///
34
+ /// It support timeouts if the `std` feature is enabled.
35
+ #[ cfg( feature = "sync" ) ]
36
+ #[ cfg_attr( docsrs, doc( cfg( feature = "sync" ) ) ) ]
37
+ pub mod sync;
38
+
39
+ /// The `futex` implementation.
40
+ ///
41
+ /// It depends on the `atomic-wait` feature.
42
+ ///
43
+ /// It does not support timeouts.
44
+ #[ cfg( feature = "futex" ) ]
45
+ #[ cfg_attr( docsrs, doc( cfg( feature = "futex" ) ) ) ]
46
+ pub mod futex;
47
+
48
+ /// The `task` implementation.
49
+ ///
50
+ /// Adding the `atomic-wait` feature or `std` feature make it more
51
+ /// concurrency-friendly for gate scenarios.
52
+ ///
53
+ /// It supports timeouts, but this requires a timer. See also [`watch()`].
54
+ ///
55
+ /// [`watch()`]: crate::task::Latch::watch
56
+ #[ cfg( feature = "task" ) ]
57
+ #[ cfg_attr( docsrs, doc( cfg( feature = "task" ) ) ) ]
58
+ pub mod task;
59
+
60
+ mod macros;
61
+
29
62
macro_rules! cfg_item {
30
- ( $feature: literal => $m: item) => {
31
- #[ cfg( feature = $feature) ]
32
- #[ cfg_attr( docsrs, doc( cfg( feature = $feature) ) ) ]
33
- $m
34
- } ;
35
63
( $mt: meta => $( $m: item) +) => {
36
64
$(
37
65
#[ cfg( $mt) ]
@@ -41,39 +69,6 @@ macro_rules! cfg_item {
41
69
} ;
42
70
}
43
71
44
- cfg_item ! { "sync" =>
45
- /// The `sync` implementation is the default implementation of threads.
46
- ///
47
- /// It depends on the `atomic-wait` feature by default, enable the `std`
48
- /// feature will change this.
49
- ///
50
- /// It support timeouts if the `std` feature is enabled.
51
- pub mod sync;
52
- }
53
-
54
- cfg_item ! { "futex" =>
55
- /// The `futex` implementation.
56
- ///
57
- /// It depends on the `atomic-wait` feature.
58
- ///
59
- /// It does not support timeouts.
60
- pub mod futex;
61
- }
62
-
63
- cfg_item ! { "task" =>
64
- /// The `task` implementation.
65
- ///
66
- /// Adding the `atomic-wait` feature or `std` feature make it more
67
- /// concurrency-friendly for gate scenarios.
68
- ///
69
- /// It supports timeouts, but this requires a timer. See also [`watch()`].
70
- ///
71
- /// [`watch()`]: crate::task::Latch::watch
72
- pub mod task;
73
- }
74
-
75
- mod macros;
76
-
77
72
cfg_item ! { any( all( feature = "sync" , feature = "std" ) , feature = "task" ) =>
78
73
pub use timeout:: * ;
79
74
mod timeout;
0 commit comments