Skip to content

Commit

Permalink
Merge pull request #363 from wesleywiser/update_timespec_init
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Nov 29, 2022
2 parents 1b4b3cb + 246ec6d commit 8a6206b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/thread_parker/linux.rs
Expand Up @@ -80,10 +80,10 @@ impl super::ThreadParkerT for ThreadParker {
self.park();
return true;
}
let ts = libc::timespec {
tv_sec: diff.as_secs() as libc::time_t,
tv_nsec: diff.subsec_nanos() as tv_nsec_t,
};
// SAFETY: libc::timespec is zero initializable.
let mut ts: libc::timespec = std::mem::zeroed();
ts.tv_sec = diff.as_secs() as libc::time_t;
ts.tv_nsec = diff.subsec_nanos() as tv_nsec_t;
self.futex_wait(Some(ts));
}
true
Expand Down

0 comments on commit 8a6206b

Please sign in to comment.