diff options
Diffstat (limited to 'src/flavors/tick.rs')
-rw-r--r-- | src/flavors/tick.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/flavors/tick.rs b/src/flavors/tick.rs index 4201b6e..d38f6a5 100644 --- a/src/flavors/tick.rs +++ b/src/flavors/tick.rs @@ -10,7 +10,6 @@ use crossbeam_utils::atomic::AtomicCell; use crate::context::Context; use crate::err::{RecvTimeoutError, TryRecvError}; use crate::select::{Operation, SelectHandle, Token}; -use crate::utils; /// Result of a receive operation. pub(crate) type TickToken = Option<Instant>; @@ -27,9 +26,9 @@ pub(crate) struct Channel { impl Channel { /// Creates a channel that delivers messages periodically. #[inline] - pub(crate) fn new(dur: Duration) -> Self { + pub(crate) fn new(delivery_time: Instant, dur: Duration) -> Self { Channel { - delivery_time: AtomicCell::new(utils::convert_timeout_to_deadline(dur)), + delivery_time: AtomicCell::new(delivery_time), duration: dur, } } |