File tree 3 files changed +9
-10
lines changed
3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -1375,9 +1375,9 @@ dependencies = [
1375
1375
1376
1376
[[package ]]
1377
1377
name = " hermit-abi"
1378
- version = " 0.1.10 "
1378
+ version = " 0.1.12 "
1379
1379
source = " registry+https://github.com/rust-lang/crates.io-index"
1380
- checksum = " 725cf19794cf90aa94e65050cb4191ff5d8fa87a498383774c47b332e3af952e "
1380
+ checksum = " 61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4 "
1381
1381
dependencies = [
1382
1382
" compiler_builtins" ,
1383
1383
" libc" ,
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ dlmalloc = { version = "0.1", features = ['rustc-dep-of-std'] }
41
41
fortanix-sgx-abi = { version = " 0.3.2" , features = [' rustc-dep-of-std' ] }
42
42
43
43
[target .'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))' .dependencies ]
44
- hermit-abi = { version = " 0.1.10 " , features = [' rustc-dep-of-std' ] }
44
+ hermit-abi = { version = " 0.1.12 " , features = [' rustc-dep-of-std' ] }
45
45
46
46
[target .wasm32-wasi .dependencies ]
47
47
wasi = { version = " 0.9.0" , features = [' rustc-dep-of-std' ], default-features = false }
Original file line number Diff line number Diff line change @@ -16,25 +16,24 @@ pub struct Thread {
16
16
unsafe impl Send for Thread { }
17
17
unsafe impl Sync for Thread { }
18
18
19
- pub const DEFAULT_MIN_STACK_SIZE : usize = 262144 ;
19
+ pub const DEFAULT_MIN_STACK_SIZE : usize = 1 << 20 ;
20
20
21
21
impl Thread {
22
22
pub unsafe fn new_with_coreid (
23
- _stack : usize ,
23
+ stack : usize ,
24
24
p : Box < dyn FnOnce ( ) > ,
25
25
core_id : isize ,
26
26
) -> io:: Result < Thread > {
27
27
let p = Box :: into_raw ( box p) ;
28
- let mut tid: Tid = u32:: MAX ;
29
- let ret = abi:: spawn (
30
- & mut tid as * mut Tid ,
28
+ let tid = abi:: spawn2 (
31
29
thread_start,
32
- & * p as * const _ as * const u8 as usize ,
30
+ p as usize ,
33
31
abi:: Priority :: into ( abi:: NORMAL_PRIO ) ,
32
+ stack,
34
33
core_id,
35
34
) ;
36
35
37
- return if ret ! = 0 {
36
+ return if tid = = 0 {
38
37
// The thread failed to start and as a result p was not consumed. Therefore, it is
39
38
// safe to reconstruct the box so that it gets deallocated.
40
39
drop ( Box :: from_raw ( p) ) ;
You can’t perform that action at this time.
0 commit comments