Skip to content

Commit 5ae0378

Browse files
committed
std: fix wasm builds
1 parent 0b3227b commit 5ae0378

File tree

1 file changed

+16
-2
lines changed
  • std/src/sys/thread_local

1 file changed

+16
-2
lines changed

std/src/sys/thread_local/mod.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,18 @@ mod guard {
8383
pub(super) use windows::enable;
8484
} else if #[cfg(any(
8585
all(target_family = "wasm", target_feature = "atomics"),
86-
target_os = "hermit",
8786
))] {
87+
pub(super) fn enable() {
88+
// FIXME: Right now there is no concept of "thread exit", but
89+
// this is likely going to show up at some point in the form of
90+
// an exported symbol that the wasm runtime is going to be
91+
// expected to call. For now we just leak everything, but if
92+
// such a function starts to exist it will probably need to
93+
// iterate the destructor list with this function:
94+
#[allow(unused)]
95+
use super::destructors::run;
96+
}
97+
} else if #[cfg(target_os = "hermit")] {
8898
pub(super) fn enable() {}
8999
} else if #[cfg(target_os = "solid_asp3")] {
90100
mod solid;
@@ -105,7 +115,11 @@ mod guard {
105115
pub(crate) mod key {
106116
cfg_if::cfg_if! {
107117
if #[cfg(any(
108-
all(not(target_vendor = "apple"), target_family = "unix"),
118+
all(
119+
not(target_vendor = "apple"),
120+
not(target_family = "wasm"),
121+
target_family = "unix",
122+
),
109123
target_os = "teeos",
110124
))] {
111125
mod racy;

0 commit comments

Comments
 (0)