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 @@ -30,17 +30,18 @@ use core::pin::Pin;
30
30
use core:: task:: { Context , Poll } ;
31
31
32
32
/// Used to signal to one of many waiters that the condition they're waiting on has happened.
33
- pub ( crate ) struct Notifier {
33
+ pub struct Notifier {
34
34
notify_pending : Mutex < ( bool , Option < Arc < Mutex < FutureState > > > ) > ,
35
35
}
36
36
37
37
impl Notifier {
38
- pub ( crate ) fn new ( ) -> Self {
38
+ /// Constructs a new notifier.
39
+ pub fn new ( ) -> Self {
39
40
Self { notify_pending : Mutex :: new ( ( false , None ) ) }
40
41
}
41
42
42
43
/// Wake waiters, tracking that wake needs to occur even if there are currently no waiters.
43
- pub ( crate ) fn notify ( & self ) {
44
+ pub fn notify ( & self ) {
44
45
let mut lock = self . notify_pending . lock ( ) . unwrap ( ) ;
45
46
if let Some ( future_state) = & lock. 1 {
46
47
if complete_future ( future_state) {
@@ -52,7 +53,7 @@ impl Notifier {
52
53
}
53
54
54
55
/// Gets a [`Future`] that will get woken up with any waiters
55
- pub ( crate ) fn get_future ( & self ) -> Future {
56
+ pub fn get_future ( & self ) -> Future {
56
57
let mut lock = self . notify_pending . lock ( ) . unwrap ( ) ;
57
58
let mut self_idx = 0 ;
58
59
if let Some ( existing_state) = & lock. 1 {
You can’t perform that action at this time.
0 commit comments