mirror of
https://github.com/Zenithsiz/dcb.git
synced 2026-02-05 00:39:31 +00:00
task::spawn now uses a std thread instead of rayon
This commit is contained in:
parent
88f80c5762
commit
9930d72dfe
@ -6,6 +6,7 @@ use std::{
|
||||
pin::Pin,
|
||||
sync::{Arc, Mutex},
|
||||
task::Poll,
|
||||
thread,
|
||||
};
|
||||
|
||||
/// Spawns a task and returns a future for awaiting it's value
|
||||
@ -18,7 +19,8 @@ pub fn spawn<T: Send + 'static>(f: impl FnOnce() -> T + Send + 'static) -> Value
|
||||
};
|
||||
|
||||
// Spawn the task
|
||||
rayon::spawn(move || {
|
||||
// TODO: If not null, maybe use a threadpool for small tasks?
|
||||
thread::spawn(move || {
|
||||
let value = f();
|
||||
*mutex.lock().expect("Poisoned") = Some(value);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user