aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/layout/construct.rs4
-rw-r--r--components/layout/flow.rs6
-rw-r--r--components/layout/flow_ref.rs6
-rw-r--r--components/layout/layout_debug.rs4
-rw-r--r--components/layout/parallel.rs10
-rw-r--r--components/util/tid.rs4
-rw-r--r--components/util/workqueue.rs6
-rw-r--r--ports/cef/browser.rs4
8 files changed, 22 insertions, 22 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 742fb2ebb3e..a13d815984d 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -53,7 +53,7 @@ use servo_util::opts;
use std::borrow::ToOwned;
use std::collections::DList;
use std::mem;
-use std::sync::atomic::Relaxed;
+use std::sync::atomic::Ordering;
use style::computed_values::{caption_side, display, empty_cells, float, list_style_position};
use style::computed_values::{position};
use style::{mod, ComputedValues};
@@ -1385,7 +1385,7 @@ impl FlowConstructionUtils for FlowRef {
}
base.children.push_back(new_child);
- let _ = base.parallel.children_count.fetch_add(1, Relaxed);
+ let _ = base.parallel.children_count.fetch_add(1, Ordering::Relaxed);
}
/// Finishes a flow. Once a flow is finished, no more child flows or fragments may be added to
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index bbfb698a2f3..8c7588f0666 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -56,7 +56,7 @@ use std::mem;
use std::fmt;
use std::iter::Zip;
use std::raw;
-use std::sync::atomic::{AtomicUint, SeqCst};
+use std::sync::atomic::{AtomicUint, Ordering};
use std::slice::MutItems;
use style::computed_values::{clear, empty_cells, float, position, text_align};
use style::ComputedValues;
@@ -781,7 +781,7 @@ impl fmt::Show for BaseFlow {
write!(f,
"@ {}, CC {}, ADC {}",
self.position,
- self.parallel.children_count.load(SeqCst),
+ self.parallel.children_count.load(Ordering::SeqCst),
self.abs_descendants.len())
}
}
@@ -830,7 +830,7 @@ impl<E, S: Encoder<E>> Encodable<S, E> for BaseFlow {
#[unsafe_destructor]
impl Drop for BaseFlow {
fn drop(&mut self) {
- if self.ref_count.load(SeqCst) != 0 {
+ if self.ref_count.load(Ordering::SeqCst) != 0 {
panic!("Flow destroyed before its ref count hit zero—this is unsafe!")
}
}
diff --git a/components/layout/flow_ref.rs b/components/layout/flow_ref.rs
index 67f306d4508..5e4d0a37563 100644
--- a/components/layout/flow_ref.rs
+++ b/components/layout/flow_ref.rs
@@ -12,7 +12,7 @@ use flow;
use std::mem;
use std::ptr;
use std::raw;
-use std::sync::atomic::SeqCst;
+use std::sync::atomic::Ordering;
#[unsafe_no_drop_flag]
pub struct FlowRef {
@@ -55,7 +55,7 @@ impl Drop for FlowRef {
if self.object.vtable.is_null() {
return
}
- if flow::base(&**self).ref_count().fetch_sub(1, SeqCst) > 1 {
+ if flow::base(&**self).ref_count().fetch_sub(1, Ordering::SeqCst) > 1 {
return
}
let flow_ref: FlowRef = mem::replace(self, FlowRef {
@@ -75,7 +75,7 @@ impl Drop for FlowRef {
impl Clone for FlowRef {
fn clone(&self) -> FlowRef {
unsafe {
- drop(flow::base(self.deref()).ref_count().fetch_add(1, SeqCst));
+ drop(flow::base(self.deref()).ref_count().fetch_add(1, Ordering::SeqCst));
FlowRef {
object: raw::TraitObject {
vtable: self.object.vtable,
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index 3b28362f326..aae0503d1eb 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -14,7 +14,7 @@ use serialize::json;
use std::borrow::ToOwned;
use std::cell::RefCell;
use std::io::File;
-use std::sync::atomic::{AtomicUint, SeqCst, INIT_ATOMIC_UINT};
+use std::sync::atomic::{AtomicUint, Ordering, INIT_ATOMIC_UINT};
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None))
@@ -96,7 +96,7 @@ impl Drop for Scope {
/// which are often reallocated but represent essentially the
/// same data.
pub fn generate_unique_debug_id() -> u16 {
- unsafe { DEBUG_ID_COUNTER.fetch_add(1, SeqCst) as u16 }
+ unsafe { DEBUG_ID_COUNTER.fetch_add(1, Ordering::SeqCst) as u16 }
}
/// Begin a layout debug trace. If this has not been called,
diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs
index a6a20ad33ba..5ec5c2c661b 100644
--- a/components/layout/parallel.rs
+++ b/components/layout/parallel.rs
@@ -23,7 +23,7 @@ use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan,
use servo_util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
use std::mem;
use std::ptr;
-use std::sync::atomic::{AtomicInt, Relaxed, SeqCst};
+use std::sync::atomic::{AtomicInt, Ordering};
#[allow(dead_code)]
fn static_assertion(node: UnsafeLayoutNode) {
@@ -108,7 +108,7 @@ pub trait ParallelPreorderDomTraversal : PreorderDomTraversal {
{
let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");
- layout_data.data.parallel.children_count.store(child_count as int, Relaxed);
+ layout_data.data.parallel.children_count.store(child_count as int, Ordering::Relaxed);
}
// Possibly enqueue the children.
@@ -173,7 +173,7 @@ trait ParallelPostorderDomTraversal : PostorderDomTraversal {
.data
.parallel
.children_count
- .fetch_sub(1, SeqCst) == 1 {
+ .fetch_sub(1, Ordering::SeqCst) == 1 {
// We were the last child of our parent. Construct flows for our parent.
} else {
// Get out of here and find another node to work on.
@@ -231,7 +231,7 @@ trait ParallelPostorderFlowTraversal : PostorderFlowTraversal {
let base = flow::mut_base(flow.deref_mut());
// Reset the count of children for the next layout traversal.
- base.parallel.children_count.store(base.children.len() as int, Relaxed);
+ base.parallel.children_count.store(base.children.len() as int, Ordering::Relaxed);
// Possibly enqueue the parent.
let unsafe_parent = base.parallel.parent;
@@ -245,7 +245,7 @@ trait ParallelPostorderFlowTraversal : PostorderFlowTraversal {
// on with our parent; otherwise, we've gotta wait.
let parent: &mut FlowRef = mem::transmute(&unsafe_parent);
let parent_base = flow::mut_base(parent.deref_mut());
- if parent_base.parallel.children_count.fetch_sub(1, SeqCst) == 1 {
+ if parent_base.parallel.children_count.fetch_sub(1, Ordering::SeqCst) == 1 {
// We were the last child of our parent. Reflow our parent.
unsafe_flow = unsafe_parent
} else {
diff --git a/components/util/tid.rs b/components/util/tid.rs
index 5cea4fe0d43..62723941fcb 100644
--- a/components/util/tid.rs
+++ b/components/util/tid.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use std::sync::atomic::{AtomicUint, INIT_ATOMIC_UINT, SeqCst};
+use std::sync::atomic::{AtomicUint, INIT_ATOMIC_UINT, Ordering};
use std::rc::Rc;
use std::cell::RefCell;
@@ -15,7 +15,7 @@ pub fn tid() -> uint {
TASK_LOCAL_TID.with(|ref k| {
let ret =
match *k.borrow() {
- None => unsafe { next_tid.fetch_add(1, SeqCst) },
+ None => unsafe { next_tid.fetch_add(1, Ordering::SeqCst) },
Some(x) => x,
};
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs
index 9fef7ac2a81..ee14a4d1a50 100644
--- a/components/util/workqueue.rs
+++ b/components/util/workqueue.rs
@@ -14,7 +14,7 @@ use libc::funcs::posix88::unistd::usleep;
use rand::{Rng, XorShiftRng};
use std::mem;
use std::rand::weak_rng;
-use std::sync::atomic::{AtomicUint, SeqCst};
+use std::sync::atomic::{AtomicUint, Ordering};
use deque::{Abort, BufferPool, Data, Empty, Stealer, Worker};
/// A unit of work.
@@ -157,7 +157,7 @@ impl<QueueData: Send, WorkData: Send> WorkerThread<QueueData, WorkData> {
// The work is done. Now decrement the count of outstanding work items. If this was
// the last work unit in the queue, then send a message on the channel.
unsafe {
- if (*ref_count).fetch_sub(1, SeqCst) == 1 {
+ if (*ref_count).fetch_sub(1, Ordering::SeqCst) == 1 {
self.chan.send(SupervisorMsg::Finished)
}
}
@@ -181,7 +181,7 @@ impl<'a, QueueData: 'static, WorkData: Send> WorkerProxy<'a, QueueData, WorkData
#[inline]
pub fn push(&mut self, work_unit: WorkUnit<QueueData, WorkData>) {
unsafe {
- drop((*self.ref_count).fetch_add(1, SeqCst));
+ drop((*self.ref_count).fetch_add(1, Ordering::SeqCst));
}
self.worker.push(work_unit);
}
diff --git a/ports/cef/browser.rs b/ports/cef/browser.rs
index 9a6aa48a35d..af7607ced73 100644
--- a/ports/cef/browser.rs
+++ b/ports/cef/browser.rs
@@ -18,7 +18,7 @@ use libc::c_int;
use servo_util::opts;
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
-use std::sync::atomic::{AtomicInt, SeqCst};
+use std::sync::atomic::{AtomicInt, Ordering};
thread_local!(pub static ID_COUNTER: AtomicInt = AtomicInt::new(0))
thread_local!(pub static BROWSERS: RefCell<Vec<CefBrowser>> = RefCell::new(vec!()))
@@ -105,7 +105,7 @@ impl ServoCefBrowser {
};
let id = ID_COUNTER.with(|counter| {
- counter.fetch_add(1, SeqCst)
+ counter.fetch_add(1, Ordering::SeqCst)
});
ServoCefBrowser {