Fix typos in atomic compare_exchange.

This commit is contained in:
JP Sugarbroad 2016-04-05 17:06:10 -07:00
parent 241a9d0ddf
commit 4883824dc5

View File

@ -327,7 +327,7 @@ pub fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> boo
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering of this
/// operation. The first describes the required ordering if the operation succeeds while the
/// second describes the required ordering when the operation fails. The failure ordering can't
/// be `Acquire` or `AcqRel` and must be equivalent or weaker than the success ordering.
/// be `Release` or `AcqRel` and must be equivalent or weaker than the success ordering.
///
/// # Examples
///
@ -376,7 +376,7 @@ pub fn compare_exchange(&self,
/// `compare_exchange_weak` takes two `Ordering` arguments to describe the memory
/// ordering of this operation. The first describes the required ordering if the operation
/// succeeds while the second describes the required ordering when the operation fails. The
/// failure ordering can't be `Acquire` or `AcqRel` and must be equivalent or weaker than the
/// failure ordering can't be `Release` or `AcqRel` and must be equivalent or weaker than the
/// success ordering.
///
/// # Examples
@ -663,7 +663,7 @@ pub fn compare_and_swap(&self, current: isize, new: isize, order: Ordering) -> i
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering of this
/// operation. The first describes the required ordering if the operation succeeds while the
/// second describes the required ordering when the operation fails. The failure ordering can't
/// be `Acquire` or `AcqRel` and must be equivalent or weaker than the success ordering.
/// be `Release` or `AcqRel` and must be equivalent or weaker than the success ordering.
///
/// # Examples
///
@ -705,7 +705,7 @@ pub fn compare_exchange(&self,
/// `compare_exchange_weak` takes two `Ordering` arguments to describe the memory
/// ordering of this operation. The first describes the required ordering if the operation
/// succeeds while the second describes the required ordering when the operation fails. The
/// failure ordering can't be `Acquire` or `AcqRel` and must be equivalent or weaker than the
/// failure ordering can't be `Release` or `AcqRel` and must be equivalent or weaker than the
/// success ordering.
///
/// # Examples
@ -939,7 +939,7 @@ pub fn compare_and_swap(&self, current: usize, new: usize, order: Ordering) -> u
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering of this
/// operation. The first describes the required ordering if the operation succeeds while the
/// second describes the required ordering when the operation fails. The failure ordering can't
/// be `Acquire` or `AcqRel` and must be equivalent or weaker than the success ordering.
/// be `Release` or `AcqRel` and must be equivalent or weaker than the success ordering.
///
/// # Examples
///
@ -981,7 +981,7 @@ pub fn compare_exchange(&self,
/// `compare_exchange_weak` takes two `Ordering` arguments to describe the memory
/// ordering of this operation. The first describes the required ordering if the operation
/// succeeds while the second describes the required ordering when the operation fails. The
/// failure ordering can't be `Acquire` or `AcqRel` and must be equivalent or weaker than the
/// failure ordering can't be `Release` or `AcqRel` and must be equivalent or weaker than the
/// success ordering.
///
/// # Examples
@ -1223,7 +1223,7 @@ pub fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) ->
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering of this
/// operation. The first describes the required ordering if the operation succeeds while the
/// second describes the required ordering when the operation fails. The failure ordering can't
/// be `Acquire` or `AcqRel` and must be equivalent or weaker than the success ordering.
/// be `Release` or `AcqRel` and must be equivalent or weaker than the success ordering.
///
/// # Examples
///
@ -1270,7 +1270,7 @@ pub fn compare_exchange(&self,
/// `compare_exchange_weak` takes two `Ordering` arguments to describe the memory
/// ordering of this operation. The first describes the required ordering if the operation
/// succeeds while the second describes the required ordering when the operation fails. The
/// failure ordering can't be `Acquire` or `AcqRel` and must be equivalent or weaker than the
/// failure ordering can't be `Release` or `AcqRel` and must be equivalent or weaker than the
/// success ordering.
///
/// # Examples
@ -1396,8 +1396,8 @@ unsafe fn atomic_compare_exchange<T>(dst: *mut T,
(AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_failrelaxed(dst, old, new),
(SeqCst, Relaxed) => intrinsics::atomic_cxchg_failrelaxed(dst, old, new),
(SeqCst, Acquire) => intrinsics::atomic_cxchg_failacq(dst, old, new),
(_, Release) => panic!("there is no such thing as an acquire/release failure ordering"),
(_, AcqRel) => panic!("there is no such thing as a release failure ordering"),
(_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"),
(_, Release) => panic!("there is no such thing as a release failure ordering"),
_ => panic!("a failure ordering can't be stronger than a success ordering"),
};
if ok {
@ -1446,8 +1446,8 @@ unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T,
(AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_failrelaxed(dst, old, new),
(SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_failrelaxed(dst, old, new),
(SeqCst, Acquire) => intrinsics::atomic_cxchgweak_failacq(dst, old, new),
(_, Release) => panic!("there is no such thing as an acquire/release failure ordering"),
(_, AcqRel) => panic!("there is no such thing as a release failure ordering"),
(_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"),
(_, Release) => panic!("there is no such thing as a release failure ordering"),
_ => panic!("a failure ordering can't be stronger than a success ordering"),
};
if ok {