fix code and comments referencing RW_LOCK_INIT

This commit is contained in:
ville-h 2015-01-04 10:57:05 +02:00
parent 5344ae2d4f
commit c3dcf9b6bf
2 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ pub use alloc::arc::{Arc, Weak};
pub use self::mutex::{Mutex, MutexGuard, StaticMutex};
pub use self::mutex::MUTEX_INIT;
pub use self::rwlock::{RwLock, StaticRwLock, RWLOCK_INIT};
pub use self::rwlock::{RwLock, StaticRwLock, RW_LOCK_INIT};
pub use self::rwlock::{RWLockReadGuard, RWLockWriteGuard};
pub use self::condvar::{Condvar, StaticCondvar, CONDVAR_INIT};
pub use self::once::{Once, ONCE_INIT};

View File

@ -76,9 +76,9 @@ unsafe impl<T> Sync for RwLock<T> {}
/// # Example
///
/// ```
/// use std::sync::{StaticRwLock, RWLOCK_INIT};
/// use std::sync::{StaticRwLock, RW_LOCK_INIT};
///
/// static LOCK: StaticRwLock = RWLOCK_INIT;
/// static LOCK: StaticRwLock = RW_LOCK_INIT;
///
/// {
/// let _g = LOCK.read().unwrap();
@ -131,7 +131,7 @@ impl<T: Send + Sync> RwLock<T> {
/// Creates a new instance of an RwLock which is unlocked and read to go.
#[stable]
pub fn new(t: T) -> RwLock<T> {
RwLock { inner: box RWLOCK_INIT, data: UnsafeCell::new(t) }
RwLock { inner: box RW_LOCK_INIT, data: UnsafeCell::new(t) }
}
/// Locks this rwlock with shared read access, blocking the current thread
@ -365,7 +365,7 @@ mod tests {
use rand::{mod, Rng};
use sync::mpsc::channel;
use thread::Thread;
use sync::{Arc, RwLock, StaticRwLock, RWLOCK_INIT};
use sync::{Arc, RwLock, StaticRwLock, RW_LOCK_INIT};
#[test]
fn smoke() {
@ -378,7 +378,7 @@ mod tests {
#[test]
fn static_smoke() {
static R: StaticRwLock = RWLOCK_INIT;
static R: StaticRwLock = RW_LOCK_INIT;
drop(R.read().unwrap());
drop(R.write().unwrap());
drop((R.read().unwrap(), R.read().unwrap()));
@ -388,7 +388,7 @@ mod tests {
#[test]
fn frob() {
static R: StaticRwLock = RWLOCK_INIT;
static R: StaticRwLock = RW_LOCK_INIT;
static N: uint = 10;
static M: uint = 1000;