diff --git a/library/std/src/sys/sync/condvar/mod.rs b/library/std/src/sys/sync/condvar/mod.rs index 83cf0ae629851..f7d7c547145c9 100644 --- a/library/std/src/sys/sync/condvar/mod.rs +++ b/library/std/src/sys/sync/condvar/mod.rs @@ -1,4 +1,8 @@ cfg_select! { + all(target_os = "emscripten", not(target_feature = "atomics")) => { + mod no_threads; + pub use no_threads::Condvar; + } any( all(target_os = "windows", not(target_vendor="win7")), target_os = "linux", diff --git a/library/std/src/sys/sync/mutex/mod.rs b/library/std/src/sys/sync/mutex/mod.rs index e3d6ad1129c83..748811b04ce62 100644 --- a/library/std/src/sys/sync/mutex/mod.rs +++ b/library/std/src/sys/sync/mutex/mod.rs @@ -1,4 +1,8 @@ cfg_select! { + all(target_os = "emscripten", not(target_feature = "atomics")) => { + mod no_threads; + pub use no_threads::Mutex; + } any( all(target_os = "windows", not(target_vendor = "win7")), target_os = "linux", diff --git a/library/std/src/sys/sync/once/mod.rs b/library/std/src/sys/sync/once/mod.rs index 5796c6d207dba..e94fa5d3610a4 100644 --- a/library/std/src/sys/sync/once/mod.rs +++ b/library/std/src/sys/sync/once/mod.rs @@ -8,6 +8,10 @@ // should help the fast path on call sites. cfg_select! { + all(target_os = "emscripten", not(target_feature = "atomics")) => { + mod no_threads; + pub use no_threads::{Once, OnceState}; + } any( all(target_os = "windows", not(target_vendor="win7")), target_os = "linux", diff --git a/library/std/src/sys/sync/rwlock/mod.rs b/library/std/src/sys/sync/rwlock/mod.rs index 8603fca2da5b5..a01f210e82d74 100644 --- a/library/std/src/sys/sync/rwlock/mod.rs +++ b/library/std/src/sys/sync/rwlock/mod.rs @@ -1,4 +1,8 @@ cfg_select! { + all(target_os = "emscripten", not(target_feature = "atomics")) => { + mod no_threads; + pub use no_threads::RwLock; + } any( all(target_os = "windows", not(target_vendor = "win7")), target_os = "linux", diff --git a/library/std/src/sys/sync/thread_parking/mod.rs b/library/std/src/sys/sync/thread_parking/mod.rs index 9d5a0a996b115..75bf63d006d79 100644 --- a/library/std/src/sys/sync/thread_parking/mod.rs +++ b/library/std/src/sys/sync/thread_parking/mod.rs @@ -1,4 +1,8 @@ cfg_select! { + all(target_os = "emscripten", not(target_feature = "atomics")) => { + mod unsupported; + pub use unsupported::Parker; + } any( all(target_os = "windows", not(target_vendor = "win7")), target_os = "linux",