Skip to content

Commit

Permalink
Rollup merge of rust-lang#114696 - g0djan:godjan/fix_114610, r=Mark-S…
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored Aug 23, 2023
2 parents 97fff1f + 9b00e5f commit 128ff08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/std/src/sys/wasi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,20 @@ cfg_if::cfg_if! {
stack_size: libc::size_t,
) -> ffi::c_int;
pub fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> ffi::c_int;
pub fn pthread_detach(thread: pthread_t) -> ffi::c_int;
}
}

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

0 comments on commit 128ff08

Please sign in to comment.