diff --git a/src/libsync/comm/oneshot.rs b/src/libsync/comm/oneshot.rs index 5b3cf33ebf0..053b5dc4c8a 100644 --- a/src/libsync/comm/oneshot.rs +++ b/src/libsync/comm/oneshot.rs @@ -43,9 +43,9 @@ use atomic; use comm::Receiver; // Various states you can find a port in. -static EMPTY: uint = 0; -static DATA: uint = 1; -static DISCONNECTED: uint = 2; +const EMPTY: uint = 0; +const DATA: uint = 1; +const DISCONNECTED: uint = 2; pub struct Packet { // Internal state of the chan/port pair (stores the blocked task as well) diff --git a/src/libsync/comm/shared.rs b/src/libsync/comm/shared.rs index cb35bd8afb7..cfd045d0882 100644 --- a/src/libsync/comm/shared.rs +++ b/src/libsync/comm/shared.rs @@ -31,12 +31,12 @@ use rustrt::thread::Thread; use atomic; use mpsc_queue as mpsc; -static DISCONNECTED: int = int::MIN; -static FUDGE: int = 1024; +const DISCONNECTED: int = int::MIN; +const FUDGE: int = 1024; #[cfg(test)] -static MAX_STEALS: int = 5; +const MAX_STEALS: int = 5; #[cfg(not(test))] -static MAX_STEALS: int = 1 << 20; +const MAX_STEALS: int = 1 << 20; pub struct Packet { queue: mpsc::Queue, diff --git a/src/libsync/comm/stream.rs b/src/libsync/comm/stream.rs index 36fe335128e..8e433c6a585 100644 --- a/src/libsync/comm/stream.rs +++ b/src/libsync/comm/stream.rs @@ -30,11 +30,11 @@ use atomic; use comm::Receiver; use spsc_queue as spsc; -static DISCONNECTED: int = int::MIN; +const DISCONNECTED: int = int::MIN; #[cfg(test)] -static MAX_STEALS: int = 5; +const MAX_STEALS: int = 5; #[cfg(not(test))] -static MAX_STEALS: int = 1 << 20; +const MAX_STEALS: int = 1 << 20; pub struct Packet { queue: spsc::Queue>, // internal queue for all message diff --git a/src/libsync/mutex.rs b/src/libsync/mutex.rs index 12de615a81b..c6413d0d09c 100644 --- a/src/libsync/mutex.rs +++ b/src/libsync/mutex.rs @@ -70,9 +70,9 @@ use rustrt::thread::Thread; use mpsc_intrusive as q; -pub static LOCKED: uint = 1 << 0; -pub static GREEN_BLOCKED: uint = 1 << 1; -pub static NATIVE_BLOCKED: uint = 1 << 2; +pub const LOCKED: uint = 1 << 0; +pub const GREEN_BLOCKED: uint = 1 << 1; +pub const NATIVE_BLOCKED: uint = 1 << 2; /// A mutual exclusion primitive useful for protecting shared data /// @@ -163,7 +163,7 @@ pub struct Guard<'a> { /// Static initialization of a mutex. This constant can be used to initialize /// other mutex constants. -pub static MUTEX_INIT: StaticMutex = StaticMutex { +pub const MUTEX_INIT: StaticMutex = StaticMutex { lock: mutex::NATIVE_MUTEX_INIT, state: atomic::INIT_ATOMIC_UINT, flavor: UnsafeCell { value: Unlocked }, diff --git a/src/libsync/one.rs b/src/libsync/one.rs index 4594345d2a3..c740c4f3d2e 100644 --- a/src/libsync/one.rs +++ b/src/libsync/one.rs @@ -45,7 +45,7 @@ pub struct Once { } /// Initialization value for static `Once` values. -pub static ONCE_INIT: Once = Once { +pub const ONCE_INIT: Once = Once { mutex: MUTEX_INIT, cnt: atomic::INIT_ATOMIC_INT, lock_cnt: atomic::INIT_ATOMIC_INT,