pub fn spawn_thread<F, T>(f: F, sequential: bool) -> ThreadHandle<F, T>
where
    F: FnOnce() -> T,
    F: Send + 'static,
    T: Send + 'static,
{
    if sequential {
        ThreadHandle {
            join_handle: None,
            f: Some(f),
        }
    } else {
        let join_handle = thread::spawn(f);
        ThreadHandle {
            join_handle: Some(join_handle),
            f: None,
        }
    }
}
Spawns a new thread with the given code, or executes it directly if the
environment variable `PERSEUS_CLI_SEQUENTIAL` is set to any valid (Unicode)
value. Multithreading is the default.
packages/perseus-cli/src/thread.rs