File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,13 @@ fn open_or_wait() -> Result<libc::c_int, Error> {
7373 Err ( _) => FD_UNINIT ,
7474 } ;
7575 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" ) ) ]
7681 sync:: wake ( ) ;
82+
7783 res
7884}
7985
@@ -101,14 +107,11 @@ mod sync {
101107 tv_sec : 0 ,
102108 tv_nsec : 0 ,
103109 } ;
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
106111 unsafe {
107112 libc:: nanosleep ( & rqtp, & mut rmtp) ;
108113 }
109114 }
110-
111- pub ( super ) fn wake ( ) { }
112115}
113116
114117#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
You can’t perform that action at this time.
0 commit comments