File tree Expand file tree Collapse file tree 3 files changed +22
-75
lines changed
library/std/src/sys/thread_local Expand file tree Collapse file tree 3 files changed +22
-75
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11use crate :: mem;
22
3+ // For WASI add a few symbols not in upstream `libc` just yet.
4+ #[ cfg( target_os = "wasi" ) ]
5+ mod libc {
6+ use crate :: ffi;
7+
8+ #[ allow( non_camel_case_types) ]
9+ pub type pthread_key_t = ffi:: c_uint ;
10+
11+ extern "C" {
12+ pub fn pthread_key_create (
13+ key : * mut pthread_key_t ,
14+ destructor : unsafe extern "C" fn ( * mut ffi:: c_void ) ,
15+ ) -> ffi:: c_int ;
16+ #[ allow( dead_code) ]
17+ pub fn pthread_getspecific ( key : pthread_key_t ) -> * mut ffi:: c_void ;
18+ pub fn pthread_setspecific ( key : pthread_key_t , value : * const ffi:: c_void ) -> ffi:: c_int ;
19+ pub fn pthread_key_delete ( key : pthread_key_t ) -> ffi:: c_int ;
20+ }
21+ }
22+
323pub type Key = libc:: pthread_key_t ;
424
525#[ inline]
Original file line number Diff line number Diff line change @@ -85,11 +85,8 @@ pub(crate) mod guard {
8585 } else if #[ cfg( target_os = "windows" ) ] {
8686 mod windows;
8787 pub ( crate ) use windows:: enable;
88- } else if #[ cfg( all( target_os = "wasi" ) ) ] {
89- mod wasi;
90- pub ( crate ) use wasi:: enable;
9188 } else if #[ cfg( any(
92- target_family = "wasm" ,
89+ all ( target_family = "wasm" , not ( target_os= "wasi" ) ) ,
9390 target_os = "uefi" ,
9491 target_os = "zkvm" ,
9592 ) ) ] {
@@ -138,6 +135,7 @@ pub(crate) mod key {
138135 target_family = "unix" ,
139136 ) ,
140137 target_os = "teeos" ,
138+ target_os = "wasi" ,
141139 ) ) ] {
142140 mod racy;
143141 mod unix;
You can’t perform that action at this time.
0 commit comments