fn detach(self: Impl) void self: Impl1566
1567
1568
1569
1570
1571
1572 fn detach(self: Impl) void {
switch (self.thread.completion.swap(.detached, .seq_cst)) {
.running => {},
.completed => self.join(),
.detached => unreachable,
}
}