1#![stable(feature = "thread_extensions", since = "1.9.0")]
6
7#[allow(deprecated)]
8use crate::os::unix::raw::pthread_t;
9use crate::sys_common::{AsInner, IntoInner};
10use crate::thread::JoinHandle;
11
12#[stable(feature = "thread_extensions", since = "1.9.0")]
13#[allow(deprecated)]
14pub type RawPthread = pthread_t;
15
16#[stable(feature = "thread_extensions", since = "1.9.0")]
18pub trait JoinHandleExt {
19 #[stable(feature = "thread_extensions", since = "1.9.0")]
21 fn as_pthread_t(&self) -> RawPthread;
22
23 #[stable(feature = "thread_extensions", since = "1.9.0")]
29 fn into_pthread_t(self) -> RawPthread;
30}
31
32#[stable(feature = "thread_extensions", since = "1.9.0")]
33impl<T> JoinHandleExt for JoinHandle<T> {
34 fn as_pthread_t(&self) -> RawPthread {
35 self.as_inner().id() as RawPthread
36 }
37
38 fn into_pthread_t(self) -> RawPthread {
39 self.into_inner().into_id() as RawPthread
40 }
41}