changes
[IRC.git] / Robust / src / Runtime / oooJava / trqueue.h
1 #ifndef TRQUEUE_H_
2 #define TRQUEUE_H_
3
4 //NOTE: SIZE MUST BE A POWER OF TWO;
5 //SIZE is used as mask to check overflow
6 #define SIZE 16384
7
8 struct trQueue {
9   void * elements[SIZE];
10   volatile unsigned int head;
11   char buffer[60];//buffer us to the next cache line
12   volatile unsigned int tail;
13 };
14
15 void enqueueTR(struct trQueue *, void * ptr);
16 void * dequeueTR(struct trQueue *);
17 struct trQueue * allocTR();
18 #endif