20 lines
652 B
Rust
20 lines
652 B
Rust
#[abi = "rust-intrinsic"]
|
|
extern mod rusti {
|
|
fn atomic_xchg(dst: &mut int, src: int) -> int;
|
|
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
|
|
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
|
|
|
|
fn atomic_xadd(dst: &mut int, src: int) -> int;
|
|
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
|
|
fn atomic_xadd_rel(dst: &mut int, src: int) -> int;
|
|
|
|
fn atomic_xsub(dst: &mut int, src: int) -> int;
|
|
fn atomic_xsub_acq(dst: &mut int, src: int) -> int;
|
|
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
|
|
}
|
|
|
|
#[inline(always)]
|
|
fn atomic_xchg(dst: &mut int, src: int) -> int {
|
|
rusti::atomic_xchg(dst, src)
|
|
}
|