diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-15 11:18:49 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-16 10:13:56 +1100 |
| commit | b87ed605c0ef27f5532ec30c92128bd890de5955 (patch) | |
| tree | 55810612bec1de77a67738853ea98539582fa809 /src/libnative | |
| parent | 75d92dbabe5bab3a1ca85c305a3773bca2e38145 (diff) | |
| download | rust-b87ed605c0ef27f5532ec30c92128bd890de5955.tar.gz rust-b87ed605c0ef27f5532ec30c92128bd890de5955.zip | |
std: Rename unstable::mutex::Mutex to StaticNativeMutex.
This better reflects its purpose and design.
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/bookkeeping.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/net.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/timer_helper.rs | 4 | ||||
| -rw-r--r-- | src/libnative/task.rs | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/libnative/bookkeeping.rs b/src/libnative/bookkeeping.rs index e0aaf20e838..b1addc5cda5 100644 --- a/src/libnative/bookkeeping.rs +++ b/src/libnative/bookkeeping.rs @@ -17,10 +17,10 @@ //! The green counterpart for this is bookkeeping on sched pools. use std::sync::atomics; -use std::unstable::mutex::{Mutex, MUTEX_INIT}; +use std::unstable::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT}; static mut TASK_COUNT: atomics::AtomicUint = atomics::INIT_ATOMIC_UINT; -static mut TASK_LOCK: Mutex = MUTEX_INIT; +static mut TASK_LOCK: StaticNativeMutex = NATIVE_MUTEX_INIT; pub fn increment() { let _ = unsafe { TASK_COUNT.fetch_add(1, atomics::SeqCst) }; diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index 1de729aee2e..b33b54862dc 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -218,9 +218,9 @@ pub fn init() { } unsafe { - use std::unstable::mutex::{Mutex, MUTEX_INIT}; + use std::unstable::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT}; static mut INITIALIZED: bool = false; - static mut LOCK: Mutex = MUTEX_INIT; + static mut LOCK: StaticNativeMutex = NATIVE_MUTEX_INIT; let _guard = LOCK.lock(); if !INITIALIZED { diff --git a/src/libnative/io/timer_helper.rs b/src/libnative/io/timer_helper.rs index 8ddce2c3990..004cd6f3114 100644 --- a/src/libnative/io/timer_helper.rs +++ b/src/libnative/io/timer_helper.rs @@ -22,7 +22,7 @@ use std::cast; use std::rt; -use std::unstable::mutex::{Mutex, MUTEX_INIT}; +use std::unstable::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT}; use bookkeeping; use io::timer::{Req, Shutdown}; @@ -37,7 +37,7 @@ static mut HELPER_CHAN: *mut Chan<Req> = 0 as *mut Chan<Req>; static mut HELPER_SIGNAL: imp::signal = 0 as imp::signal; pub fn boot(helper: fn(imp::signal, Port<Req>)) { - static mut LOCK: Mutex = MUTEX_INIT; + static mut LOCK: StaticNativeMutex = NATIVE_MUTEX_INIT; static mut INITIALIZED: bool = false; unsafe { diff --git a/src/libnative/task.rs b/src/libnative/task.rs index d940edcadc7..e4a8c45eb0b 100644 --- a/src/libnative/task.rs +++ b/src/libnative/task.rs @@ -22,7 +22,7 @@ use std::rt::task::{Task, BlockedTask, SendMessage}; use std::rt::thread::Thread; use std::rt; use std::task::TaskOpts; -use std::unstable::mutex::Mutex; +use std::unstable::mutex::StaticNativeMutex; use std::unstable::stack; use io; @@ -40,7 +40,7 @@ pub fn new(stack_bounds: (uint, uint)) -> ~Task { fn ops() -> ~Ops { ~Ops { - lock: unsafe { Mutex::new() }, + lock: unsafe { StaticNativeMutex::new() }, awoken: false, io: io::IoFactory::new(), // these *should* get overwritten @@ -109,7 +109,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) { // This structure is the glue between channels and the 1:1 scheduling mode. This // structure is allocated once per task. struct Ops { - lock: Mutex, // native synchronization + lock: StaticNativeMutex, // native synchronization awoken: bool, // used to prevent spurious wakeups io: io::IoFactory, // local I/O factory |
