aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/blocking
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-11-02 18:47:23 -0800
committerHaibo Huang <hhb@google.com>2020-11-02 18:47:23 -0800
commitbdf61e668e0593f8bcd0d30c512e7d5dbd09e38e (patch)
tree8847c6faf37c650915f060a07b3a0594cbff4b95 /src/runtime/blocking
parent4e8243bbb2f7f2747e80aafd270af79afebd0f38 (diff)
downloadtokio-bdf61e668e0593f8bcd0d30c512e7d5dbd09e38e.tar.gz
Upgrade rust/crates/tokio to 0.3.3
Test: make Change-Id: I8fdff1bab68b03bc1fe8179d07e79bd6ece31027
Diffstat (limited to 'src/runtime/blocking')
-rw-r--r--src/runtime/blocking/pool.rs2
-rw-r--r--src/runtime/blocking/task.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/blocking/pool.rs b/src/runtime/blocking/pool.rs
index 2967a10..6b9fb1b 100644
--- a/src/runtime/blocking/pool.rs
+++ b/src/runtime/blocking/pool.rs
@@ -70,6 +70,7 @@ const KEEP_ALIVE: Duration = Duration::from_secs(10);
pub(crate) fn spawn_blocking<F, R>(func: F) -> JoinHandle<R>
where
F: FnOnce() -> R + Send + 'static,
+ R: Send + 'static,
{
let rt = context::current().expect("not currently running on the Tokio runtime.");
rt.spawn_blocking(func)
@@ -79,6 +80,7 @@ where
pub(crate) fn try_spawn_blocking<F, R>(func: F) -> Result<(), ()>
where
F: FnOnce() -> R + Send + 'static,
+ R: Send + 'static,
{
let rt = context::current().expect("not currently running on the Tokio runtime.");
diff --git a/src/runtime/blocking/task.rs b/src/runtime/blocking/task.rs
index a521af4..ee2d8d6 100644
--- a/src/runtime/blocking/task.rs
+++ b/src/runtime/blocking/task.rs
@@ -19,7 +19,8 @@ impl<T> Unpin for BlockingTask<T> {}
impl<T, R> Future for BlockingTask<T>
where
- T: FnOnce() -> R,
+ T: FnOnce() -> R + Send + 'static,
+ R: Send + 'static,
{
type Output = R;