Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
g0djan committed Aug 16, 2023
1 parent 42a7080 commit 9b00e5f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions library/std/src/sys/wasi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ cfg_if::cfg_if! {
pub struct Thread {
id: libc::pthread_t,
}

impl Drop for Thread {
fn drop(&mut self) {
let ret = unsafe { libc::pthread_detach(self.id) };
debug_assert_eq!(ret, 0);
}
}
} else {
pub struct Thread(!);
}
Expand Down Expand Up @@ -179,17 +186,6 @@ impl Thread {
}
}

cfg_if::cfg_if! {
if #[cfg(target_feature = "atomics")] {
impl Drop for Thread {
fn drop(&mut self) {
let ret = unsafe { libc::pthread_detach(self.id) };
debug_assert_eq!(ret, 0);
}
}
}
}

pub fn available_parallelism() -> io::Result<NonZeroUsize> {
unsupported()
}
Expand Down

0 comments on commit 9b00e5f

Please sign in to comment.