Skip to content

Commit 9b00e5f

Browse files
committed
address comments
1 parent 42a7080 commit 9b00e5f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

library/std/src/sys/wasi/thread.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ cfg_if::cfg_if! {
5454
pub struct Thread {
5555
id: libc::pthread_t,
5656
}
57+
58+
impl Drop for Thread {
59+
fn drop(&mut self) {
60+
let ret = unsafe { libc::pthread_detach(self.id) };
61+
debug_assert_eq!(ret, 0);
62+
}
63+
}
5764
} else {
5865
pub struct Thread(!);
5966
}
@@ -179,17 +186,6 @@ impl Thread {
179186
}
180187
}
181188

182-
cfg_if::cfg_if! {
183-
if #[cfg(target_feature = "atomics")] {
184-
impl Drop for Thread {
185-
fn drop(&mut self) {
186-
let ret = unsafe { libc::pthread_detach(self.id) };
187-
debug_assert_eq!(ret, 0);
188-
}
189-
}
190-
}
191-
}
192-
193189
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
194190
unsupported()
195191
}

0 commit comments

Comments
 (0)