Fix Compositor concurrent initialization
It seems that initializing the compositor in a different thread can cause issues in some environments.
This commit is contained in:
parent
d203392c9d
commit
1b22d7d5fc
8 changed files with 37 additions and 14 deletions
|
|
@ -50,12 +50,10 @@ where
|
|||
self.executor.enter(f)
|
||||
}
|
||||
|
||||
/// Spawns a [`Future`] in the [`Runtime`].
|
||||
pub fn spawn(
|
||||
&mut self,
|
||||
future: impl Future<Output = ()> + MaybeSend + 'static,
|
||||
) {
|
||||
self.executor.spawn(future);
|
||||
/// Runs a future to completion in the current thread within the [`Runtime`].
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn block_on<T>(&mut self, future: impl Future<Output = T>) -> T {
|
||||
self.executor.block_on(future)
|
||||
}
|
||||
|
||||
/// Runs a [`Stream`] in the [`Runtime`] until completion.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue