mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 10:30:40 +00:00
ts/runtime/scheduler: check must_awake before sleeping
This commit is contained in:
parent
1573522520
commit
64dd588734
1 changed files with 9 additions and 8 deletions
|
@ -213,7 +213,12 @@ impl Scheduler {
|
|||
}
|
||||
|
||||
let mut must_awake = self.must_awake.lock().unwrap();
|
||||
let mut must_awake = loop {
|
||||
loop {
|
||||
if *must_awake {
|
||||
*must_awake = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if let Some(wait_duration) = self.max_throttling.checked_sub(last.elapsed()) {
|
||||
let result = self
|
||||
.must_awake_cvar
|
||||
|
@ -221,15 +226,11 @@ impl Scheduler {
|
|||
.unwrap();
|
||||
|
||||
must_awake = result.0;
|
||||
if *must_awake {
|
||||
break must_awake;
|
||||
}
|
||||
} else {
|
||||
break must_awake;
|
||||
*must_awake = false;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
*must_awake = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue