aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/sys
diff options
context:
space:
mode:
authorFenrir <[email protected]>2018-01-22 00:30:33 -0700
committerFenrirWolf <[email protected]>2018-01-22 00:39:14 -0700
commitc1573807d59082cf705028a302b8ba15de88ab3e (patch)
tree4f249855adf952a94c04d81e51fe1e009b88bba4 /ctr-std/src/sys
parentEnsure that the sysroot uses its own libc (diff)
downloadctru-rs-c1573807d59082cf705028a302b8ba15de88ab3e.tar.xz
ctru-rs-c1573807d59082cf705028a302b8ba15de88ab3e.zip
Restore thread APIs that were accidentally deleted
Oops.
Diffstat (limited to 'ctr-std/src/sys')
-rw-r--r--ctr-std/src/sys/unix/thread.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/ctr-std/src/sys/unix/thread.rs b/ctr-std/src/sys/unix/thread.rs
index 21224ad..76aa55a 100644
--- a/ctr-std/src/sys/unix/thread.rs
+++ b/ctr-std/src/sys/unix/thread.rs
@@ -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 {