-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-threadArea: `std::thread`Area: `std::thread`O-wasiOperating system: Wasi, Webassembly System InterfaceOperating system: Wasi, Webassembly System InterfaceT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
there is no pthread_detach
call (there is no impl Drop
at all), so users that want to create a detached thread end up leaking the pthread_t
handle.
compare to the Unix Thread
:
rust/library/std/src/sys/unix/thread.rs
Lines 280 to 285 in 8e7fd55
impl Drop for Thread { | |
fn drop(&mut self) { | |
let ret = unsafe { libc::pthread_detach(self.id) }; | |
debug_assert_eq!(ret, 0); | |
} | |
} |
Metadata
Metadata
Assignees
Labels
A-threadArea: `std::thread`Area: `std::thread`O-wasiOperating system: Wasi, Webassembly System InterfaceOperating system: Wasi, Webassembly System InterfaceT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.