Conditionally enable multithreaded implementation

This commit is contained in:
Maximilian Ammann 2022-09-08 19:42:38 +02:00
parent d912975b1e
commit e06d122dbb
4 changed files with 5 additions and 12 deletions

View File

@ -41,11 +41,3 @@ tracing-wasm = { version = "0.2.1", optional = true } # FIXME: Low quality depen
[dev-dependencies]
wasm-bindgen-test = "0.3.31"
[profile.dev]
lto = true
codegen-units = 1
opt-level = 's'
panic = "abort"
strip = "debuginfo"

View File

@ -42,9 +42,8 @@ pub fn wasm_bindgen_start() {
pub fn create_pool_scheduler(
new_worker: js_sys::Function,
) -> *mut Scheduler<WebWorkerPoolScheduleMethod> {
let scheduler = Box::new(Scheduler::new(WebWorkerPoolScheduleMethod::new(new_worker)));
Box::into_raw(scheduler)
let scheduler = Scheduler::new(WebWorkerPoolScheduleMethod::new(new_worker));
Box::into_raw(Box::new(scheduler))
}
#[wasm_bindgen]

View File

@ -1,3 +1,6 @@
pub mod http_client;
#[cfg(target_feature = "atomics")]
pub mod pool;
#[cfg(target_feature = "atomics")]
pub mod pool_schedule_method;

View File

@ -4,7 +4,6 @@
use std::borrow::BorrowMut;
use std::future::Future;
use std::sync::Mutex;
use std::{cell::RefCell, rc::Rc};
use js_sys::Promise;