Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Laignel <fengalin@free.fr>2022-09-01 18:54:05 +0300
committerSebastian Dröge <slomo@coaxion.net>2022-09-13 10:29:50 +0300
commit61c62ee1e85d48578a11e4e84366885fcd0fe4ac (patch)
treef1913e624e16e2553daf4186d9cd4f665db53ded /generic/threadshare/src/inputselector
parent235ded35fd71082ac9ec78502ba462adb238d38f (diff)
ts/timers: multiple improvements
This commit improves threadshare timers predictability by better making use of current time slice. Added a dedicate timer BTreeMap for after timers (those that are guaranteed to fire no sooner than the expected instant) so as to avoid previous workaround which added half the max throttling duration. These timers can now be checked against the reactor processing instant. Oneshot timers only need to be polled as `Future`s when intervals are `Stream`s. This also reduces the size for oneshot timers and make user call `next` on intervals. Intervals can also implement `FusedStream`, which can help when used in features such as `select!`. Also drop the `time` module, which was kepts for compatibility when the `executor` was migrated from tokio based to smol-like.
Diffstat (limited to 'generic/threadshare/src/inputselector')
-rw-r--r--generic/threadshare/src/inputselector/imp.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs
index 5ab487d88..41d962de4 100644
--- a/generic/threadshare/src/inputselector/imp.rs
+++ b/generic/threadshare/src/inputselector/imp.rs
@@ -83,7 +83,9 @@ impl InputSelectorPadSinkHandler {
let now = element.current_running_time();
match running_time.into().opt_checked_sub(now) {
- Ok(Some(delay)) => runtime::time::delay_for(delay.into()).await,
+ Ok(Some(delay)) => {
+ runtime::timer::delay_for(delay.into()).await;
+ }
_ => runtime::executor::yield_now().await,
}
}