We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42a7080 commit 9b00e5fCopy full SHA for 9b00e5f
library/std/src/sys/wasi/thread.rs
@@ -54,6 +54,13 @@ cfg_if::cfg_if! {
54
pub struct Thread {
55
id: libc::pthread_t,
56
}
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
64
} else {
65
pub struct Thread(!);
66
@@ -179,17 +186,6 @@ impl Thread {
179
186
180
187
181
188
182
-cfg_if::cfg_if! {
183
- if #[cfg(target_feature = "atomics")] {
184
- impl Drop for Thread {
185
- fn drop(&mut self) {
- let ret = unsafe { libc::pthread_detach(self.id) };
- debug_assert_eq!(ret, 0);
- }
189
190
191
-}
192
-
193
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
194
unsupported()
195
0 commit comments