11 #ifndef COUNTED_PTR_HPP__
12 #define COUNTED_PTR_HPP__
24 volatile unsigned long sn;
26 volatile unsigned long long all;
33 cp_cas(
volatile unsigned long long* addr,
34 void* expected_ptr,
unsigned long expected_sn,
37 unsigned long new_sn = expected_sn + 1;
39 old_cp.
p.
ptr = expected_ptr; old_cp.
p.
sn = expected_sn;
41 new_cp.
p.
ptr = new_ptr; new_cp.
p.
sn = new_sn;;
45 #endif // COUNTED_PTR_HPP__
#define __sync_bool_compare_and_swap(p, f, t)
Definition: icc-sync.hpp:48
union counted_ptr __attribute__((aligned(8)))
Definition: counted_ptr.hpp:20
void *volatile ptr
Definition: counted_ptr.hpp:23
volatile unsigned long long all
Definition: counted_ptr.hpp:26
volatile unsigned long sn
Definition: counted_ptr.hpp:24
struct counted_ptr::@17 p
static bool cp_cas(volatile unsigned long long *addr, void *expected_ptr, unsigned long expected_sn, void *new_ptr)
Definition: counted_ptr.hpp:33