1 #ifndef BAMBOO_MULTICORE_TASK_H
2 #define BAMBOO_MULTICORE_TASK_H
5 // TASK specific data structures
6 // get rid of lock msgs for GC version
8 // data structures for locking
9 struct RuntimeHash locktable;
10 static struct RuntimeHash* locktbl = &locktable;
11 struct RuntimeHash * lockRedirectTbl;
12 struct RuntimeHash * objRedirectLockTbl;
13 #endif // ifndef MULTICORE_GC
23 // data structures for waiting objs
24 struct Queue objqueue;
25 struct Queue * totransobjqueue; // queue to hold objs to be transferred
26 // should be cleared whenever enter a task
31 // lock related functions
32 bool getreadlock(void* ptr);
33 void releasereadlock(void* ptr);
34 bool getwritelock(void* ptr);
35 void releasewritelock(void* ptr);
36 bool getwritelock_I(void* ptr);
37 void releasewritelock_I(void * ptr);
39 void releasewritelock_r(void * lock, void * redirectlock);
40 #endif // ifndef MULTICORE_GC
41 /* this function is to process lock requests.
42 * can only be invoked in receiveObject_I() */
43 // if return -1: the lock request is redirected
44 // 0: the lock request is approved
45 // 1: the lock request is denied
46 INLINE int processlockrequest_I(int locktype,
52 INLINE void processlockrelease_I(int locktype,
57 INLINE void inittaskdata();
58 INLINE void distaskdata();
60 #define INITTASKDATA() inittaskdata()
61 #define DISTASKDATA() distaskdata()
63 #define INITTASKDATA()
66 #endif // BAMBOO_MULTICORE_TASK_H