@@ -27,22 +27,22 @@ pub trait SignalMechanism: Send + Sync + Debug {
27
27
/// Initializes the [`SignalMechanism`] in place.
28
28
///
29
29
/// # Safety
30
- /// * [`SignalMechanism::init()`] must not be called before
30
+ /// * [`SignalMechanism::init()`] must called exactly once before all other methods
31
31
unsafe fn init ( & mut self ) -> Result < ( ) , ListenerCreateError > ;
32
32
33
33
/// Notifies the counter-part of the [`SignalMechanism`] meaning
34
34
/// that a [`SignalMechanism::try_wait()`], [`SignalMechanism::timed_wait()`]
35
35
/// or [`SignalMechanism::blocking_wait()`] call wakes up and returns true.
36
36
///
37
37
/// # Safety
38
- /// * [`SignalMechanism::init()`] must be called before
38
+ /// * [`SignalMechanism::init()`] must have been called exactly once
39
39
/// * Must not be dropped while in use from another process
40
40
unsafe fn notify ( & self ) -> Result < ( ) , NotifierNotifyError > ;
41
41
42
42
/// When a signal was received it returns true, otherwise false.
43
43
///
44
44
/// # Safety
45
- /// * [`SignalMechanism::init()`] must be called before
45
+ /// * [`SignalMechanism::init()`] must have been called exactly once
46
46
/// * Must not be dropped while in use from another process
47
47
unsafe fn try_wait ( & self ) -> Result < bool , ListenerWaitError > ;
48
48
@@ -54,7 +54,7 @@ pub trait SignalMechanism: Send + Sync + Debug {
54
54
/// it returns [`ListenerWaitError::InterruptSignal`].
55
55
///
56
56
/// # Safety
57
- /// * [`SignalMechanism::init()`] must be called before
57
+ /// * [`SignalMechanism::init()`] must have been called exactly once
58
58
/// * Must not be dropped while in use from another process
59
59
unsafe fn timed_wait ( & self , timeout : Duration ) -> Result < bool , ListenerWaitError > ;
60
60
@@ -64,7 +64,7 @@ pub trait SignalMechanism: Send + Sync + Debug {
64
64
/// it returns [`ListenerWaitError::InterruptSignal`].
65
65
///
66
66
/// # Safety
67
- /// * [`SignalMechanism::init()`] must called before
67
+ /// * [`SignalMechanism::init()`] must have been called exactly once
68
68
/// * Must not be dropped while in use from another process
69
69
unsafe fn blocking_wait ( & self ) -> Result < ( ) , ListenerWaitError > ;
70
70
}
0 commit comments