fn detach(self: Impl) void
self: Impl
869 870 871 872 873 874 875
fn detach(self: Impl) void { switch (self.thread.state.swap(.detached, .seq_cst)) { .running => {}, .completed => self.join(), .detached => unreachable, } }