From 04c24bf47b7bc7ee380f9899bc3139cd9c17dae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0koudlil?= Date: Mon, 8 Jan 2024 09:55:21 +0100 Subject: [PATCH] Changed Timer_ to not require clock ownership This allows to implement timers that can share single clock among them. This commit is preparation for feature sim time. --- r2r/src/nodes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r2r/src/nodes.rs b/r2r/src/nodes.rs index 5cc2842..3e86d5f 100644 --- a/r2r/src/nodes.rs +++ b/r2r/src/nodes.rs @@ -1241,7 +1241,7 @@ impl Node { let timer = Timer_ { timer_handle, - _clock: clock, + _clock: Some(clock), sender: tx, }; self.timers.push(timer); @@ -1279,7 +1279,7 @@ impl RclTimer { struct Timer_ { timer_handle: Pin>, - _clock: Clock, // just here to be dropped properly later. + _clock: Option, // Some(clock) if the timer owns the clock, just here to be dropped properly later. sender: mpsc::Sender, }