about summary refs log tree commit diff
path: root/library/std/src/sys/wasi/mod.rs
diff options
context:
space:
mode:
authorGeorgii Rylov <g0dj4n@gmail.com>2023-07-26 17:26:20 +0100
committerGeorgii Rylov <g0dj4n@gmail.com>2023-07-29 16:37:50 +0100
commit5697f1620de6bede6f575b51b01509d8c07830cf (patch)
tree702e0cabd6faa61e0bbb4f356987d4332ea30011 /library/std/src/sys/wasi/mod.rs
parentf9f674f2bcf9cb67ef29123dd3a631485cba22c8 (diff)
downloadrust-5697f1620de6bede6f575b51b01509d8c07830cf.tar.gz
rust-5697f1620de6bede6f575b51b01509d8c07830cf.zip
Add wasm32-wasi-threads target + WASI threads
Diffstat (limited to 'library/std/src/sys/wasi/mod.rs')
-rw-r--r--library/std/src/sys/wasi/mod.rs22
1 files changed, 17 insertions, 5 deletions
diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/wasi/mod.rs
index a2223708024..98517da1d0f 100644
--- a/library/std/src/sys/wasi/mod.rs
+++ b/library/std/src/sys/wasi/mod.rs
@@ -29,8 +29,7 @@ pub mod fs;
 #[path = "../wasm/atomics/futex.rs"]
 pub mod futex;
 pub mod io;
-#[path = "../unsupported/locks/mod.rs"]
-pub mod locks;
+
 pub mod net;
 pub mod os;
 #[path = "../unix/os_str.rs"]
@@ -47,14 +46,27 @@ pub mod thread;
 pub mod thread_local_dtor;
 #[path = "../unsupported/thread_local_key.rs"]
 pub mod thread_local_key;
-#[path = "../unsupported/thread_parking.rs"]
-pub mod thread_parking;
 pub mod time;
 
 cfg_if::cfg_if! {
-    if #[cfg(not(target_feature = "atomics"))] {
+    if #[cfg(target_feature = "atomics")] {
+        #[path = "../unix/locks"]
+        pub mod locks {
+            #![allow(unsafe_op_in_unsafe_fn)]
+            mod futex_condvar;
+            mod futex_mutex;
+            mod futex_rwlock;
+            pub(crate) use futex_condvar::Condvar;
+            pub(crate) use futex_mutex::Mutex;
+            pub(crate) use futex_rwlock::RwLock;
+        }
+    } else {
+        #[path = "../unsupported/locks/mod.rs"]
+        pub mod locks;
         #[path = "../unsupported/once.rs"]
         pub mod once;
+        #[path = "../unsupported/thread_parking.rs"]
+        pub mod thread_parking;
     }
 }