Skip to content

wasi preview1 + threads Thread type missing Drop that calls pthread_detach #114610

Closed
@programmerjake

Description

@programmerjake

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:

impl Drop for Thread {
fn drop(&mut self) {
let ret = unsafe { libc::pthread_detach(self.id) };
debug_assert_eq!(ret, 0);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-threadArea: `std::thread`O-wasiOperating system: Wasi, Webassembly System InterfaceT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions