summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/game_of_life/Cargo.toml2
-rw-r--r--futures/Cargo.toml4
-rw-r--r--futures/src/executor/tokio.rs3
-rw-r--r--src/executor.rs3
4 files changed, 7 insertions, 5 deletions
diff --git a/examples/game_of_life/Cargo.toml b/examples/game_of_life/Cargo.toml
index b9bb7f2a..9c4172c4 100644
--- a/examples/game_of_life/Cargo.toml
+++ b/examples/game_of_life/Cargo.toml
@@ -7,6 +7,6 @@ publish = false
[dependencies]
iced = { path = "../..", features = ["canvas", "tokio", "debug"] }
-tokio = { version = "0.2", features = ["blocking"] }
+tokio = { version = "0.3", features = ["sync"] }
itertools = "0.9"
rustc-hash = "1.1"
diff --git a/futures/Cargo.toml b/futures/Cargo.toml
index 275d0391..078c96aa 100644
--- a/futures/Cargo.toml
+++ b/futures/Cargo.toml
@@ -20,9 +20,9 @@ log = "0.4"
version = "0.3"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
-version = "0.2"
+version = "0.3"
optional = true
-features = ["rt-core", "rt-threaded", "time", "stream"]
+features = ["rt-multi-thread", "time", "stream"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.async-std]
version = "1.0"
diff --git a/futures/src/executor/tokio.rs b/futures/src/executor/tokio.rs
index a730bce8..c6a21cec 100644
--- a/futures/src/executor/tokio.rs
+++ b/futures/src/executor/tokio.rs
@@ -16,6 +16,7 @@ impl Executor for Tokio {
}
fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
- tokio::runtime::Runtime::enter(self, f)
+ let _guard = tokio::runtime::Runtime::enter(self);
+ f()
}
}
diff --git a/src/executor.rs b/src/executor.rs
index ea6ab14a..34538fb6 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -40,7 +40,8 @@ mod platform {
}
fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
- self.0.enter(f)
+ let _guard = self.0.enter();
+ f()
}
}
}