Skip to content

Commit ab4362f

Browse files
committed
Support wasm64
1 parent 38a76dc commit ab4362f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ async-channel = "1.5.0"
2222
fastrand = "1.4.0"
2323
futures-lite = "1.11.0"
2424

25-
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
25+
[target.'cfg(any(target_arch = "wasm32", target_arch = "wasm64"))'.dev-dependencies]
2626
wasm-bindgen-test = "0.3"

src/mutex.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::process;
66
use std::sync::atomic::{AtomicUsize, Ordering};
77
use std::sync::Arc;
88

9-
#[cfg(not(target_arch = "wasm32"))]
9+
#[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))]
1010
use std::time::{Duration, Instant};
1111

1212
use std::usize;
@@ -114,7 +114,7 @@ impl<T: ?Sized> Mutex<T> {
114114
#[cold]
115115
async fn acquire_slow(&self) {
116116
// Get the current time.
117-
#[cfg(not(target_arch = "wasm32"))]
117+
#[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))]
118118
let start = Instant::now();
119119

120120
loop {
@@ -163,7 +163,7 @@ impl<T: ?Sized> Mutex<T> {
163163

164164
// If waiting for too long, fall back to a fairer locking strategy that will prevent
165165
// newer lock operations from starving us forever.
166-
#[cfg(not(target_arch = "wasm32"))]
166+
#[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))]
167167
if start.elapsed() > Duration::from_micros(500) {
168168
break;
169169
}

0 commit comments

Comments
 (0)