mirror of
https://github.com/fluencelabs/wasm-timer
synced 2025-04-24 10:42:13 +00:00
Fix WASM build
This commit is contained in:
parent
e0207bd1c1
commit
ee6f010a87
@ -2,7 +2,7 @@
|
||||
name = "wasm-timer"
|
||||
edition = "2018"
|
||||
description = "Abstraction over std::time::Instant and futures-timer that works on WASM"
|
||||
version = "0.2.3"
|
||||
version = "0.2.4"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/tomaka/wasm-timer"
|
||||
|
@ -1,4 +1,4 @@
|
||||
use futures::task::ArcWake;
|
||||
use futures::task::{self, ArcWake};
|
||||
use parking_lot::Mutex;
|
||||
use std::convert::TryFrom;
|
||||
use std::future::Future;
|
||||
@ -33,7 +33,7 @@ fn schedule_callback(timer: Arc<Mutex<Timer>>, when: Duration) {
|
||||
// We start by polling the timer. If any new `Delay` is created, the waker will be used
|
||||
// to wake up this task pre-emptively. As such, we pass a `Waker` that calls
|
||||
// `schedule_callback` with a delay of `0`.
|
||||
let waker = Arc::new(Waker { timer: timer.clone() }).into_waker();
|
||||
let waker = task::waker(Arc::new(Waker { timer: timer.clone() }));
|
||||
let _ = Future::poll(Pin::new(&mut *timer_lock), &mut Context::from_waker(&waker));
|
||||
|
||||
// Notify the timers that are ready.
|
||||
|
Loading…
x
Reference in New Issue
Block a user