From 9a3d04ae7629f6f273643b3a14f106726842be6a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 27 Mar 2014 15:09:47 -0700 Subject: std: Switch field privacy as necessary --- src/libstd/sync/arc.rs | 2 +- src/libstd/sync/atomics.rs | 18 +++++++++--------- src/libstd/sync/deque.rs | 6 +++--- src/libstd/sync/mpmc_bounded_queue.rs | 2 +- src/libstd/sync/mpsc_queue.rs | 4 ++-- src/libstd/sync/spsc_queue.rs | 16 ++++++++-------- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/libstd/sync') diff --git a/src/libstd/sync/arc.rs b/src/libstd/sync/arc.rs index 92974005305..0d0bd740e41 100644 --- a/src/libstd/sync/arc.rs +++ b/src/libstd/sync/arc.rs @@ -35,7 +35,7 @@ use ty::Unsafe; /// Enforces no shared-memory safety. #[unsafe_no_drop_flag] pub struct UnsafeArc { - priv data: *mut ArcData, + data: *mut ArcData, } struct ArcData { diff --git a/src/libstd/sync/atomics.rs b/src/libstd/sync/atomics.rs index 6cc2f85bd95..234eae1f97b 100644 --- a/src/libstd/sync/atomics.rs +++ b/src/libstd/sync/atomics.rs @@ -116,26 +116,26 @@ use ty::Unsafe; /// An atomic boolean type. pub struct AtomicBool { - priv v: Unsafe, - priv nocopy: marker::NoCopy + v: Unsafe, + nocopy: marker::NoCopy } /// A signed atomic integer type, supporting basic atomic arithmetic operations pub struct AtomicInt { - priv v: Unsafe, - priv nocopy: marker::NoCopy + v: Unsafe, + nocopy: marker::NoCopy } /// An unsigned atomic integer type, supporting basic atomic arithmetic operations pub struct AtomicUint { - priv v: Unsafe, - priv nocopy: marker::NoCopy + v: Unsafe, + nocopy: marker::NoCopy } /// An unsafe atomic pointer. Only supports basic atomic operations pub struct AtomicPtr { - priv p: Unsafe, - priv nocopy: marker::NoCopy + p: Unsafe, + nocopy: marker::NoCopy } /// An atomic, nullable unique pointer @@ -144,7 +144,7 @@ pub struct AtomicPtr { /// owned heap objects across tasks. #[unsafe_no_drop_flag] pub struct AtomicOption { - priv p: Unsafe, + p: Unsafe, } /// Atomic memory orderings diff --git a/src/libstd/sync/deque.rs b/src/libstd/sync/deque.rs index 80a5b9ce3bb..d01c89878de 100644 --- a/src/libstd/sync/deque.rs +++ b/src/libstd/sync/deque.rs @@ -86,14 +86,14 @@ struct Deque { /// /// There may only be one worker per deque. pub struct Worker { - priv deque: UnsafeArc>, + deque: UnsafeArc>, } /// The stealing half of the work-stealing deque. Stealers have access to the /// opposite end of the deque from the worker, and they only have access to the /// `steal` method. pub struct Stealer { - priv deque: UnsafeArc>, + deque: UnsafeArc>, } /// When stealing some data, this is an enumeration of the possible outcomes. @@ -116,7 +116,7 @@ pub enum Stolen { /// will only use this structure when allocating a new buffer or deallocating a /// previous one. pub struct BufferPool { - priv pool: Exclusive<~[~Buffer]>, + pool: Exclusive<~[~Buffer]>, } /// An internal buffer used by the chase-lev deque. This structure is actually diff --git a/src/libstd/sync/mpmc_bounded_queue.rs b/src/libstd/sync/mpmc_bounded_queue.rs index dfa962cdb80..12c05c0d61c 100644 --- a/src/libstd/sync/mpmc_bounded_queue.rs +++ b/src/libstd/sync/mpmc_bounded_queue.rs @@ -54,7 +54,7 @@ struct State { } pub struct Queue { - priv state: UnsafeArc>, + state: UnsafeArc>, } impl State { diff --git a/src/libstd/sync/mpsc_queue.rs b/src/libstd/sync/mpsc_queue.rs index 9d69f2b3b08..142a6239df6 100644 --- a/src/libstd/sync/mpsc_queue.rs +++ b/src/libstd/sync/mpsc_queue.rs @@ -67,8 +67,8 @@ struct Node { /// may be safely shared so long as it is guaranteed that there is only one /// popper at a time (many pushers are allowed). pub struct Queue { - priv head: AtomicPtr>, - priv tail: *mut Node, + head: AtomicPtr>, + tail: *mut Node, } impl Node { diff --git a/src/libstd/sync/spsc_queue.rs b/src/libstd/sync/spsc_queue.rs index 9277587e587..4e043ecf171 100644 --- a/src/libstd/sync/spsc_queue.rs +++ b/src/libstd/sync/spsc_queue.rs @@ -55,19 +55,19 @@ struct Node { /// time. pub struct Queue { // consumer fields - priv tail: *mut Node, // where to pop from - priv tail_prev: AtomicPtr>, // where to pop from + tail: *mut Node, // where to pop from + tail_prev: AtomicPtr>, // where to pop from // producer fields - priv head: *mut Node, // where to push to - priv first: *mut Node, // where to get new nodes from - priv tail_copy: *mut Node, // between first/tail + head: *mut Node, // where to push to + first: *mut Node, // where to get new nodes from + tail_copy: *mut Node, // between first/tail // Cache maintenance fields. Additions and subtractions are stored // separately in order to allow them to use nonatomic addition/subtraction. - priv cache_bound: uint, - priv cache_additions: AtomicUint, - priv cache_subtractions: AtomicUint, + cache_bound: uint, + cache_additions: AtomicUint, + cache_subtractions: AtomicUint, } impl Node { -- cgit 1.4.1-3-g733a5