auto merge of #20896 : sfackler/rust/atomic-rename, r=alexcrichton
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize Closes #20893 [breaking-change]
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::atomic::{self, AtomicUint, Ordering};
|
||||
use sync::atomic::{self, AtomicUsize, Ordering};
|
||||
use sync::{Mutex, Once, ONCE_INIT};
|
||||
|
||||
use sys::thread_local as imp;
|
||||
@@ -97,7 +97,7 @@ pub struct StaticKey {
|
||||
|
||||
/// Inner contents of `StaticKey`, created by the `INIT_INNER` constant.
|
||||
pub struct StaticKeyInner {
|
||||
key: AtomicUint,
|
||||
key: AtomicUsize,
|
||||
}
|
||||
|
||||
/// A type for a safely managed OS-based TLS slot.
|
||||
@@ -137,7 +137,7 @@ pub const INIT: StaticKey = StaticKey {
|
||||
///
|
||||
/// This value allows specific configuration of the destructor for a TLS key.
|
||||
pub const INIT_INNER: StaticKeyInner = StaticKeyInner {
|
||||
key: atomic::ATOMIC_UINT_INIT,
|
||||
key: atomic::ATOMIC_USIZE_INIT,
|
||||
};
|
||||
|
||||
static INIT_KEYS: Once = ONCE_INIT;
|
||||
|
||||
@@ -211,7 +211,7 @@ impl Timer {
|
||||
// instead of ()
|
||||
HELPER.boot(|| {}, helper);
|
||||
|
||||
static ID: atomic::AtomicUint = atomic::ATOMIC_UINT_INIT;
|
||||
static ID: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT;
|
||||
let id = ID.fetch_add(1, Ordering::Relaxed);
|
||||
Ok(Timer {
|
||||
id: id,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
|
||||
use sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
|
||||
use alloc::{self, heap};
|
||||
|
||||
use libc::DWORD;
|
||||
@@ -18,9 +18,9 @@ use sys::sync as ffi;
|
||||
|
||||
const SPIN_COUNT: DWORD = 4000;
|
||||
|
||||
pub struct Mutex { inner: AtomicUint }
|
||||
pub struct Mutex { inner: AtomicUsize }
|
||||
|
||||
pub const MUTEX_INIT: Mutex = Mutex { inner: ATOMIC_UINT_INIT };
|
||||
pub const MUTEX_INIT: Mutex = Mutex { inner: ATOMIC_USIZE_INIT };
|
||||
|
||||
unsafe impl Sync for Mutex {}
|
||||
|
||||
@@ -32,7 +32,7 @@ pub unsafe fn raw(m: &Mutex) -> ffi::LPCRITICAL_SECTION {
|
||||
impl Mutex {
|
||||
#[inline]
|
||||
pub unsafe fn new() -> Mutex {
|
||||
Mutex { inner: AtomicUint::new(init_lock() as uint) }
|
||||
Mutex { inner: AtomicUsize::new(init_lock() as uint) }
|
||||
}
|
||||
#[inline]
|
||||
pub unsafe fn lock(&self) {
|
||||
|
||||
Reference in New Issue
Block a user