kcl_lib/thread/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! An implementation of threads that works in wasm with promises and other platforms with tokio.

#[cfg(not(target_arch = "wasm32"))]
pub mod local;
#[cfg(not(target_arch = "wasm32"))]
pub use local::JoinHandle;

#[cfg(target_arch = "wasm32")]
#[cfg(not(test))]
pub mod wasm;

#[cfg(target_arch = "wasm32")]
#[cfg(not(test))]
pub use wasm::JoinHandle;

pub trait Thread {
    /// Abort a thread.
    fn abort(&self);

    /// Check if a thread is finished.
    fn is_finished(&self) -> bool;
}