Contains first sketch of waiting queue logic. The WaitingQueue struct will be removed...
[IRC.git] / Robust / src / Runtime / oooJava / WaitingQueue.h
1 /*
2  * waitingQueue.h
3  *
4  *  Created on: Sep 1, 2010
5  *      Author: stephey
6  */
7 #ifndef WAITINGQUEUE_H_
8 #define WAITINGQUEUE_H_
9
10 #define NUMITEMS 20
11
12 /* print header */
13 struct TraverserData {
14   void * resumePtr;
15   int traverserID;
16   int effectType;
17 };
18
19 struct BinVector {
20   struct TraverserData array[NUMITEMS];
21   struct BinVector * next;
22   int index;
23 };
24
25 struct BinElement {
26   struct BinVector * head;
27   struct BinVector * tail;
28   int size;
29 };
30
31
32 //TODO in the future, remove this struct all together
33 struct WaitingQueue {
34   struct BinElement * array;
35 };
36
37 void put(int allocSiteID, struct WaitingQueue * queue, int effectType, void * resumePtr, int traverserID);
38 int check(struct WaitingQueue * queue, int allocSiteID);
39 struct WaitingQueue * mallocWaitingQueue(int size);
40 void returnVectorToFreePool(struct BinVector *ptr);
41 void resolveChain(struct WaitingQueue * queue, int allocSiteID);
42 struct BinVector * mallocNewVector();
43 struct BinVector * getUsableVector();
44 struct BinVector * getUsableVector();
45
46 #endif /* WAITINGQUEUE_H_ */