#![feature(await_macro, async_await, futures_api)] use std::future::Future; use std::sync::Mutex; use std::sync::Arc; use tokio::{runtime::Runtime}; async fn do_nothing() { } async fn foo(count: Arc>) { let mut x = count.lock().unwrap(); *x += 1; await!(do_nothing()); } fn main() { let runtime = Runtime::new().unwrap(); let executor = runtime.executor(); let x = Arc::new(Mutex::new(0)); executor.spawn(foo(x.clone())); }