Skip to content

Commit 164b0f6

Browse files
committed
---
yaml --- r: 142997 b: refs/heads/try2 c: 28c9ba9 h: refs/heads/master i: 142995: 2554009 v: v3
1 parent a393c5c commit 164b0f6

File tree

2 files changed

+1
-69
lines changed

2 files changed

+1
-69
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5a9b33a76d76a77d2ced1c2430a25faa0f284071
8+
refs/heads/try2: 28c9ba91d85e651ecf3568159bc3dfb45882baf8
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/unstable/sync.rs

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -205,50 +205,6 @@ extern {
205205
fn rust_unlock_little_lock(lock: rust_little_lock);
206206
}
207207

208-
/* *********************************************************************/
209-
210-
//FIXME: #5042 This should be replaced by proper atomic type
211-
pub struct AtomicUint {
212-
priv inner: uint
213-
}
214-
215-
impl AtomicUint {
216-
pub fn new(val: uint) -> AtomicUint { AtomicUint { inner: val } }
217-
pub fn load(&self) -> uint {
218-
unsafe { intrinsics::atomic_load(cast::transmute(self)) as uint }
219-
}
220-
pub fn store(&mut self, val: uint) {
221-
unsafe { intrinsics::atomic_store(cast::transmute(self), val as int); }
222-
}
223-
pub fn add(&mut self, val: int) -> uint {
224-
unsafe { intrinsics::atomic_xadd(cast::transmute(self), val as int) as uint }
225-
}
226-
pub fn cas(&mut self, old:uint, new: uint) -> uint {
227-
unsafe { intrinsics::atomic_cxchg(cast::transmute(self), old as int, new as int) as uint }
228-
}
229-
}
230-
231-
pub struct AtomicInt {
232-
priv inner: int
233-
}
234-
235-
impl AtomicInt {
236-
pub fn new(val: int) -> AtomicInt { AtomicInt { inner: val } }
237-
pub fn load(&self) -> int {
238-
unsafe { intrinsics::atomic_load(&self.inner) }
239-
}
240-
pub fn store(&mut self, val: int) {
241-
unsafe { intrinsics::atomic_store(&mut self.inner, val); }
242-
}
243-
pub fn add(&mut self, val: int) -> int {
244-
unsafe { intrinsics::atomic_xadd(&mut self.inner, val) }
245-
}
246-
pub fn cas(&mut self, old: int, new: int) -> int {
247-
unsafe { intrinsics::atomic_cxchg(&mut self.inner, old, new) }
248-
}
249-
}
250-
251-
252208
#[cfg(test)]
253209
mod tests {
254210
use super::*;
@@ -307,28 +263,4 @@ mod tests {
307263
}
308264
}
309265
}
310-
311-
#[test]
312-
fn atomic_int_smoke_test() {
313-
let mut i = AtomicInt::new(0);
314-
i.store(10);
315-
assert!(i.load() == 10);
316-
assert!(i.add(1) == 10);
317-
assert!(i.load() == 11);
318-
assert!(i.cas(11, 12) == 11);
319-
assert!(i.cas(11, 13) == 12);
320-
assert!(i.load() == 12);
321-
}
322-
323-
#[test]
324-
fn atomic_uint_smoke_test() {
325-
let mut i = AtomicUint::new(0);
326-
i.store(10);
327-
assert!(i.load() == 10);
328-
assert!(i.add(1) == 10);
329-
assert!(i.load() == 11);
330-
assert!(i.cas(11, 12) == 11);
331-
assert!(i.cas(11, 13) == 12);
332-
assert!(i.load() == 12);
333-
}
334266
}

0 commit comments

Comments
 (0)