8 typedef unsigned long long pointer;
9 typedef atomic_ullong pointer_t;
11 #define MAKE_POINTER(ptr, count) ((((pointer)count) << 32) | ptr)
12 #define PTR_MASK 0xffffffffLL
13 #define COUNT_MASK (0xffffffffLL << 32)
15 static inline void set_count(pointer *p, unsigned int val) { *p = (*p & ~COUNT_MASK) | ((pointer)val << 32); }
16 static inline void set_ptr(pointer *p, unsigned int val) { *p = (*p & ~PTR_MASK) | val; }
17 static inline unsigned int get_count(pointer p) { return (p & COUNT_MASK) >> 32; }
18 static inline unsigned int get_ptr(pointer p) { return p & PTR_MASK; }
28 node_t nodes[MAX_NODES + 1];
31 void init_queue(queue_t *q, int num_threads);
39 typedef struct tag_elem {
45 list<tag_elem_t> __queue;
48 __queue = list<tag_elem_t>();
49 tag = 1; // Beginning of available id
51 # Only check the happens-before relationship according to the id of the
52 # commit_point_set. For commit_point_set that has same ID, A -> B means
53 # B happens after the previous A.
63 @Commit_point_set: Enqueue_Success_Point
66 # __ID__ is an internal macro that refers to the id of the current
71 __queue.push_back(elem);
74 void enqueue(queue_t *q, unsigned int val);
79 @Commit_point_set: Dequeue_Success_Point
80 @ID: __queue.back().id
82 unsigned int _Old_Val = __queue.front().data;
88 unsigned int dequeue(queue_t *q);