-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6: Add compare_and_swap, compare_exchange, compare_exchange_weak r=torkleyy,kvark a=dbkaplun Add compare_and_swap, compare_exchange, compare_exchange_weak: ```rust // https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.compare_and_swap pub fn compare_and_swap( &self, current: Option<&P>, new: Option<P>, order: Ordering, ) -> Result<Option<P>, (Option<P>, *mut P)>; // Err returns `new` back, and the current pointer in AtomicPtr. // https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.compare_exchange pub fn compare_exchange( &self, current: Option<&P>, new: Option<P>, success: Ordering, failure: Ordering, ) -> Result<Option<P>, (Option<P>, *mut P)>; // Err returns `new` back, and the current pointer in AtomicPtr. // https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.compare_exchange_weak pub fn compare_exchange_weak( &self, current: Option<&P>, new: Option<P>, success: Ordering, failure: Ordering, ) -> Result<Option<P>, (Option<P>, *mut P)>; // Err returns `new` back, and the current pointer in AtomicPtr. ``` Closes #5 Co-authored-by: Dan Kaplun <[email protected]>
- Loading branch information
Showing
2 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters