every.channel: sanitized baseline
This commit is contained in:
commit
897e556bea
258 changed files with 74298 additions and 0 deletions
12
third_party/iroh-live/moq-media/src/util.rs
vendored
Normal file
12
third_party/iroh-live/moq-media/src/util.rs
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/// Spawn a named OS thread and panic if spawning fails.
|
||||
pub fn spawn_thread<F, T>(name: impl ToString, f: F) -> std::thread::JoinHandle<T>
|
||||
where
|
||||
F: FnOnce() -> T + Send + 'static,
|
||||
T: Send + 'static,
|
||||
{
|
||||
let name_str = name.to_string();
|
||||
std::thread::Builder::new()
|
||||
.name(name_str.clone())
|
||||
.spawn(f)
|
||||
.expect(&format!("failed to spawn thread: {}", name_str))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue