Browse Source

Restore thread APIs that were accidentally deleted

Oops.
pull/10/head
Fenrir 7 years ago committed by FenrirWolf
parent
commit
c1573807d5
  1. 18
      ctr-std/src/sys/unix/thread.rs

18
ctr-std/src/sys/unix/thread.rs

@ -80,6 +80,24 @@ impl Thread { @@ -80,6 +80,24 @@ impl Thread {
debug_assert_eq!(ret, 0);
}
}
#[allow(dead_code)]
pub fn id(&self) -> ThreadHandle {
self.handle
}
#[allow(dead_code)]
pub fn into_id(self) -> ThreadHandle {
let handle = self.handle;
mem::forget(self);
handle
}
}
impl Drop for Thread {
fn drop(&mut self) {
unsafe { ::libctru::threadDetach(self.handle) }
}
}
pub mod guard {

Loading…
Cancel
Save