linux: only tick the main thread tasks and one at a time in the event loop
This commit is contained in:
parent
f92be4b817
commit
1c410c1b99
3 changed files with 10 additions and 4 deletions
|
@ -46,6 +46,13 @@ impl LinuxDispatcher {
|
|||
main_thread_id: thread::current().id(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tick_main(&self) {
|
||||
assert!(self.is_main_thread());
|
||||
if let Ok(runnable) = self.main_receiver.try_recv() {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PlatformDispatcher for LinuxDispatcher {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue