File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,20 @@ use core::pin::Pin;
31
31
32
32
33
33
/// Used to signal to one of many waiters that the condition they're waiting on has happened.
34
- pub ( crate ) struct Notifier {
34
+ pub struct Notifier {
35
35
notify_pending : Mutex < ( bool , Option < Arc < Mutex < FutureState > > > ) > ,
36
36
}
37
37
38
38
impl Notifier {
39
- pub ( crate ) fn new ( ) -> Self {
39
+ /// Constructs a new notifier.
40
+ pub fn new ( ) -> Self {
40
41
Self {
41
42
notify_pending : Mutex :: new ( ( false , None ) ) ,
42
43
}
43
44
}
44
45
45
46
/// Wake waiters, tracking that wake needs to occur even if there are currently no waiters.
46
- pub ( crate ) fn notify ( & self ) {
47
+ pub fn notify ( & self ) {
47
48
let mut lock = self . notify_pending . lock ( ) . unwrap ( ) ;
48
49
if let Some ( future_state) = & lock. 1 {
49
50
if complete_future ( future_state) {
@@ -55,7 +56,7 @@ impl Notifier {
55
56
}
56
57
57
58
/// Gets a [`Future`] that will get woken up with any waiters
58
- pub ( crate ) fn get_future ( & self ) -> Future {
59
+ pub fn get_future ( & self ) -> Future {
59
60
let mut lock = self . notify_pending . lock ( ) . unwrap ( ) ;
60
61
let mut self_idx = 0 ;
61
62
if let Some ( existing_state) = & lock. 1 {
You can’t perform that action at this time.
0 commit comments