5 typedef unsigned long long pointer;
6 typedef atomic_ullong pointer_t;
8 #define MAKE_POINTER(ptr, count) ((((pointer)count) << 32) | ptr)
9 #define PTR_MASK 0xffffffffLL
10 #define COUNT_MASK (0xffffffffLL << 32)
12 static inline void set_count(pointer *p, unsigned int val) { *p = (*p & ~COUNT_MASK) | ((pointer)val << 32); }
13 static inline void set_ptr(pointer *p, unsigned int val) { *p = (*p & ~PTR_MASK) | val; }
14 static inline unsigned int get_count(pointer p) { return (p & COUNT_MASK) >> 32; }
15 static inline unsigned int get_ptr(pointer p) { return p & PTR_MASK; }
25 node_t nodes[MAX_NODES + 1];
28 void init_queue(queue_t *q, int num_threads);
34 typedef struct tag_elem {
38 tag_elem(Tag _id, unsigned int _data) {
44 spec_queue<tag_elem_t> queue;
47 queue = spec_queue<tag_elem_t>();
50 # Only check the happens-before relationship according to the id of the
51 # commit_point_set. For commit_point_set that has same ID, A -> B means
52 # B happens after the previous A.
62 @Commit_point_set: Enqueue_Success_Point
63 @ID: __sequential.tag.getCurAndInc()
65 # __ID__ is an internal macro that refers to the id of the current
67 __sequential.queue.enqueue(tag_elem_t(__ID__, val));
70 void enqueue(queue_t *q, unsigned int val);
75 @Commit_point_set: Dequeue_Success_Point
76 @ID: __sequential.queue.peak().tag
78 unsigned int _Old_Val = __sequential.queue.dequeue().data;
83 unsigned int dequeue(queue_t *q);