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); |
|
} |
|
} |
there is no
pthread_detachcall (there is noimpl Dropat all), so users that want to create a detached thread end up leaking thepthread_thandle.compare to the Unix
Thread:rust/library/std/src/sys/unix/thread.rs
Lines 280 to 285 in 8e7fd55