@@ -23,23 +23,23 @@ impl Condvar {
23
23
}
24
24
25
25
/// # Safety
26
- /// `init` must have been called.
26
+ /// `init` must have been called on this instance .
27
27
#[ inline]
28
28
pub unsafe fn notify_one ( self : Pin < & Self > ) {
29
29
let r = unsafe { libc:: pthread_cond_signal ( self . raw ( ) ) } ;
30
30
debug_assert_eq ! ( r, 0 ) ;
31
31
}
32
32
33
33
/// # Safety
34
- /// `init` must have been called.
34
+ /// `init` must have been called on this instance .
35
35
#[ inline]
36
36
pub unsafe fn notify_all ( self : Pin < & Self > ) {
37
37
let r = unsafe { libc:: pthread_cond_broadcast ( self . raw ( ) ) } ;
38
38
debug_assert_eq ! ( r, 0 ) ;
39
39
}
40
40
41
41
/// # Safety
42
- /// * `init` must have been called.
42
+ /// * `init` must have been called on this instance .
43
43
/// * `mutex` must be locked by the current thread.
44
44
/// * This condition variable may only be used with the same mutex.
45
45
#[ inline]
@@ -49,7 +49,7 @@ impl Condvar {
49
49
}
50
50
51
51
/// # Safety
52
- /// * `init` must have been called.
52
+ /// * `init` must have been called on this instance .
53
53
/// * `mutex` must be locked by the current thread.
54
54
/// * This condition variable may only be used with the same mutex.
55
55
pub unsafe fn wait_timeout ( & self , mutex : Pin < & Mutex > , dur : Duration ) -> bool {
@@ -95,7 +95,7 @@ impl Condvar {
95
95
const CLOCK : libc:: clockid_t = libc:: CLOCK_MONOTONIC ;
96
96
97
97
/// # Safety
98
- /// May only be called once.
98
+ /// May only be called once per instance of `Self` .
99
99
pub unsafe fn init ( self : Pin < & mut Self > ) {
100
100
use crate :: mem:: MaybeUninit ;
101
101
@@ -137,7 +137,7 @@ impl Condvar {
137
137
const CLOCK : libc:: clockid_t = libc:: CLOCK_REALTIME ;
138
138
139
139
/// # Safety
140
- /// May only be called once.
140
+ /// May only be called once per instance of `Self` .
141
141
pub unsafe fn init ( self : Pin < & mut Self > ) {
142
142
if cfg ! ( any( target_os = "espidf" , target_os = "horizon" , target_os = "teeos" ) ) {
143
143
// NOTE: ESP-IDF's PTHREAD_COND_INITIALIZER support is not released yet
0 commit comments