]> git.lizzy.rs Git - rust.git/commitdiff
SGX target: Expose thread id function in os module
authorJethro Beekman <jethro@fortanix.com>
Tue, 5 Mar 2019 21:32:41 +0000 (13:32 -0800)
committerJethro Beekman <jethro@fortanix.com>
Tue, 5 Mar 2019 21:35:57 +0000 (13:35 -0800)
src/libstd/os/fortanix_sgx/mod.rs
src/libstd/sys/sgx/abi/thread.rs

index bca22e717d7245cfa496bbdaf6aa5f234e38ff83..4e30b1edd15e82dc7171328699fd3e23f2de679a 100644 (file)
@@ -43,3 +43,8 @@ pub mod mem {
 }
 
 pub use crate::sys::ext::{io, arch, ffi};
+
+/// Functions for querying thread-related information.
+pub mod thread {
+    pub use crate::sys::abi::thread::current;
+}
index 86fe09d003520c5477152a3eddc2605a655cc5d7..c17fa2d00159ee305a1db0df35a248e714b4b350 100644 (file)
@@ -4,6 +4,7 @@
 /// all currently running threads in the enclave, and it is guaranteed to be
 /// constant for the lifetime of the thread. More specifically for SGX, there
 /// is a one-to-one correspondence of the ID to the address of the TCS.
+#[unstable(feature = "sgx_platform", issue = "56975")]
 pub fn current() -> Tcs {
     extern "C" { fn get_tcs_addr() -> Tcs; }
     unsafe { get_tcs_addr() }