pub fn spawn_careless<F, T>(priority: ThreadPriority, f: F) -> JoinHandle<T>
Expand description
Spawns a thread with the specified priority.
This is different from spawn
in a way that the passed function doesn’t
need to accept the ThreadPriority::set_for_current
result.
In case of an error, the error is logged using the logging facilities.
See spawn
.
use thread_priority::*;
let thread = spawn_careless(ThreadPriority::Max, || {
// This is printed out from within the spawned thread.
println!("We don't care about the priority result.");
});
thread.join();