mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-16 21:05:15 +00:00
ts/runtime: rewrite runnable loop
Previous version relied on a plain loop / match / break because I experimented different strategies. The while variant is better for the final solution.
This commit is contained in:
parent
8bab034bc8
commit
1573522520
1 changed files with 9 additions and 14 deletions
|
@ -200,21 +200,16 @@ impl Scheduler {
|
||||||
reactor.react().ok()
|
reactor.react().ok()
|
||||||
});
|
});
|
||||||
|
|
||||||
loop {
|
while let Ok(runnable) = self.tasks.pop_runnable() {
|
||||||
match self.tasks.pop_runnable() {
|
panic::catch_unwind(|| runnable.run()).map_err(|err| {
|
||||||
Err(_) => break,
|
gst_error!(
|
||||||
Ok(runnable) => {
|
RUNTIME_CAT,
|
||||||
panic::catch_unwind(|| runnable.run()).map_err(|err| {
|
"A task has panicked within Context {}",
|
||||||
gst_error!(
|
self.context_name
|
||||||
RUNTIME_CAT,
|
);
|
||||||
"A task has panicked within Context {}",
|
|
||||||
self.context_name
|
|
||||||
);
|
|
||||||
|
|
||||||
err
|
err
|
||||||
})?;
|
})?;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut must_awake = self.must_awake.lock().unwrap();
|
let mut must_awake = self.must_awake.lock().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue