6 typedef unsigned long long pointer;
7 typedef atomic_ullong pointer_t;
9 #define MAKE_POINTER(ptr, count) ((((pointer)count) << 32) | ptr)
10 #define PTR_MASK 0xffffffffLL
11 #define COUNT_MASK (0xffffffffLL << 32)
13 static inline void set_count(pointer *p, unsigned int val) { *p = (*p & ~COUNT_MASK) | ((pointer)val << 32); }
14 static inline void set_ptr(pointer *p, unsigned int val) { *p = (*p & ~PTR_MASK) | val; }
15 static inline unsigned int get_count(pointer p) { return (p & COUNT_MASK) >> 32; }
16 static inline unsigned int get_ptr(pointer p) { return p & PTR_MASK; }
26 node_t nodes[MAX_NODES + 1];
29 void init_queue(queue_t *q, int num_threads);
30 void enqueue(queue_t *q, unsigned int val);
31 bool dequeue(queue_t *q, unsigned int *retVal);