mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-19 16:01:23 +00:00
Add in (unsafe and incorrect) impls of Send/Sync that are now required.
This commit is contained in:
@ -26,8 +26,8 @@ use wasm_bindgen::prelude::*;
|
||||
pub struct JsFuture {
|
||||
resolved: oneshot::Receiver<JsValue>,
|
||||
rejected: oneshot::Receiver<JsValue>,
|
||||
_cb_resolve: Closure<FnMut(JsValue)>,
|
||||
_cb_reject: Closure<FnMut(JsValue)>,
|
||||
_cb_resolve: Closure<dyn FnMut(JsValue)>,
|
||||
_cb_reject: Closure<dyn FnMut(JsValue)>,
|
||||
}
|
||||
|
||||
impl fmt::Debug for JsFuture {
|
||||
@ -143,6 +143,10 @@ where
|
||||
is_queued: Cell<bool>,
|
||||
}
|
||||
|
||||
// TODO This is only safe because JS is currently single-threaded
|
||||
unsafe impl Send for Task {}
|
||||
unsafe impl Sync for Task {}
|
||||
|
||||
impl Task {
|
||||
#[inline]
|
||||
fn new<F>(future: F) -> Arc<Self>
|
||||
|
Reference in New Issue
Block a user