File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,13 @@ fn open_or_wait() -> Result<libc::c_int, Error> {
73
73
Err ( _) => FD_UNINIT ,
74
74
} ;
75
75
FD . store ( val, Ordering :: Release ) ;
76
+
77
+ // On non-Linux targets `wait` is just 1 ms sleep,
78
+ // so we don't need any explicit wake up in addition
79
+ // to updating value of `FD`.
80
+ #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
76
81
sync:: wake ( ) ;
82
+
77
83
res
78
84
}
79
85
@@ -101,14 +107,11 @@ mod sync {
101
107
tv_sec : 0 ,
102
108
tv_nsec : 0 ,
103
109
} ;
104
- // We ignore return value since we do not care
105
- // if sleep is interrupted
110
+ // We do not care if sleep gets interrupted, so the return value is ignored
106
111
unsafe {
107
112
libc:: nanosleep ( & rqtp, & mut rmtp) ;
108
113
}
109
114
}
110
-
111
- pub ( super ) fn wake ( ) { }
112
115
}
113
116
114
117
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
You can’t perform that action at this time.
0 commit comments