Skip to content

Commit a2f078d

Browse files
committed
std: fix wasm+threads build
1 parent 32f9b8b commit a2f078d

File tree

1 file changed

+11
-1
lines changed
  • library/std/src/sys/thread_local

1 file changed

+11
-1
lines changed

library/std/src/sys/thread_local/mod.rs

+11-1
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;

0 commit comments

Comments
 (0)