diff options
| author | bors <bors@rust-lang.org> | 2020-05-06 16:59:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-06 16:59:45 +0000 |
| commit | 1836e3b42a5b2f37fd79104eedbe8f48a5afdee6 (patch) | |
| tree | 3ccc77fe3cc8fd490bb01d89e2d94815a9affec0 /src/libstd | |
| parent | 339f574809bf8e4166b8de3cdbe7df181d37af3d (diff) | |
| parent | fbb4ccbee61dc95afcbcd05fd63053e2980edf97 (diff) | |
| download | rust-1836e3b42a5b2f37fd79104eedbe8f48a5afdee6.tar.gz rust-1836e3b42a5b2f37fd79104eedbe8f48a5afdee6.zip | |
Auto merge of #71951 - Dylan-DPC:rollup-j9v1p0f, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - #71269 (Define UB in float-to-int casts to saturate) - #71591 (use new interface to create threads on HermitCore) - #71819 (x.py: Give a more helpful error message if curl isn't installed) - #71893 (Use the `impls` module to import pre-existing dataflow analyses) - #71929 (Use -fvisibility=hidden for libunwind) - #71937 (Ignore SGX on a few ui tests) - #71944 (Add comment for `Ord` implementation for array) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/libstd/sys/hermit/thread.rs | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index ceb39c01c67..923d5fa8cac 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -41,7 +41,7 @@ dlmalloc = { version = "0.1", features = ['rustc-dep-of-std'] } fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] } [target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies] -hermit-abi = { version = "0.1.10", features = ['rustc-dep-of-std'] } +hermit-abi = { version = "0.1.12", features = ['rustc-dep-of-std'] } [target.wasm32-wasi.dependencies] wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false } diff --git a/src/libstd/sys/hermit/thread.rs b/src/libstd/sys/hermit/thread.rs index 7e3fb4c6d20..e11afed6687 100644 --- a/src/libstd/sys/hermit/thread.rs +++ b/src/libstd/sys/hermit/thread.rs @@ -16,25 +16,24 @@ pub struct Thread { unsafe impl Send for Thread {} unsafe impl Sync for Thread {} -pub const DEFAULT_MIN_STACK_SIZE: usize = 262144; +pub const DEFAULT_MIN_STACK_SIZE: usize = 1 << 20; impl Thread { pub unsafe fn new_with_coreid( - _stack: usize, + stack: usize, p: Box<dyn FnOnce()>, core_id: isize, ) -> io::Result<Thread> { let p = Box::into_raw(box p); - let mut tid: Tid = u32::MAX; - let ret = abi::spawn( - &mut tid as *mut Tid, + let tid = abi::spawn2( thread_start, - &*p as *const _ as *const u8 as usize, + p as usize, abi::Priority::into(abi::NORMAL_PRIO), + stack, core_id, ); - return if ret != 0 { + return if tid == 0 { // The thread failed to start and as a result p was not consumed. Therefore, it is // safe to reconstruct the box so that it gets deallocated. drop(Box::from_raw(p)); |
