about summary refs log tree commit diff
path: root/src/libstd/sys/wasm/thread.rs
diff options
context:
space:
mode:
authorStein Somers <git@steinsomers.be>2019-01-09 15:15:18 +0100
committerStein Somers <git@steinsomers.be>2019-01-09 15:15:18 +0100
commitccba43df81d5bda37c9e4d231ad4443e6f3a7e44 (patch)
treeefe674e2d5ae721f38fa8558385e0a2f12997227 /src/libstd/sys/wasm/thread.rs
parentf9f71cc32497ee4e3cbc7d9795bcf358a9268c13 (diff)
parent664c7797f6bfddf9f5e67474c2fd8017f91d7110 (diff)
downloadrust-ccba43df81d5bda37c9e4d231ad4443e6f3a7e44.tar.gz
rust-ccba43df81d5bda37c9e4d231ad4443e6f3a7e44.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/libstd/sys/wasm/thread.rs')
-rw-r--r--src/libstd/sys/wasm/thread.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libstd/sys/wasm/thread.rs b/src/libstd/sys/wasm/thread.rs
index f9abb0b825a..c2322088e8e 100644
--- a/src/libstd/sys/wasm/thread.rs
+++ b/src/libstd/sys/wasm/thread.rs
@@ -1,13 +1,3 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 use boxed::FnBox;
 use ffi::CStr;
 use io;
@@ -41,7 +31,7 @@ impl Thread {
 
     #[cfg(target_feature = "atomics")]
     pub fn sleep(dur: Duration) {
-        use arch::wasm32::atomic;
+        use arch::wasm32;
         use cmp;
 
         // Use an atomic wait to block the current thread artificially with a
@@ -53,7 +43,7 @@ impl Thread {
         while nanos > 0 {
             let amt = cmp::min(i64::max_value() as u128, nanos);
             let mut x = 0;
-            let val = unsafe { atomic::wait_i32(&mut x, 0, amt as i64) };
+            let val = unsafe { wasm32::i32_atomic_wait(&mut x, 0, amt as i64) };
             debug_assert_eq!(val, 2);
             nanos -= amt;
         }
@@ -107,7 +97,7 @@ cfg_if! {
             panic!("thread local data not implemented on wasm with atomics yet")
         }
 
-        pub fn tcb_set(ptr: *mut u8) {
+        pub fn tcb_set(_ptr: *mut u8) {
             panic!("thread local data not implemented on wasm with atomics yet")
         }
     } else {