Changes in src/libcfa/concurrency/kernel [85b1deb:a1a17a74]
- File:
-
- 1 edited
-
src/libcfa/concurrency/kernel (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel
r85b1deb ra1a17a74 23 23 extern "C" { 24 24 #include <pthread.h> 25 #include <semaphore.h>26 25 } 27 26 … … 44 43 extern struct cluster * mainCluster; 45 44 46 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule, Callback }; 47 48 typedef void (*__finish_callback_fptr_t)(void); 45 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule }; 49 46 50 47 //TODO use union, many of these fields are mutually exclusive (i.e. MULTI vs NOMULTI) 51 48 struct FinishAction { 52 49 FinishOpCode action_code; 53 /*54 // Union of possible actions55 union {56 // Option 1 : locks and threads57 struct {58 // 1 thread or N thread59 union {60 thread_desc * thrd;61 struct {62 thread_desc ** thrds;63 unsigned short thrd_count;64 };65 };66 // 1 lock or N lock67 union {68 __spinlock_t * lock;69 struct {70 __spinlock_t ** locks;71 unsigned short lock_count;72 };73 };74 };75 // Option 2 : action pointer76 __finish_callback_fptr_t callback;77 };78 /*/79 50 thread_desc * thrd; 80 thread_desc ** thrds;81 unsigned short thrd_count;82 51 __spinlock_t * lock; 83 52 __spinlock_t ** locks; 84 53 unsigned short lock_count; 85 __finish_callback_fptr_t callback;86 //*/54 thread_desc ** thrds; 55 unsigned short thrd_count; 87 56 }; 88 57 static inline void ?{}(FinishAction & this) { … … 113 82 pthread_t kernel_thread; 114 83 84 // Termination 85 // Set to true to notify the processor should terminate 86 volatile bool do_terminate; 87 88 // Termination synchronisation 89 semaphore terminated; 90 115 91 // RunThread data 116 92 // Action to do after a thread is ran … … 125 101 126 102 // Idle lock 127 __bin_sem_t idleLock;128 129 // Termination130 // Set to true to notify the processor should terminate131 volatile bool do_terminate;132 133 // Termination synchronisation134 semaphore terminated;135 103 136 104 // Link lists fields 137 struct __dbg_node_proc{105 struct { 138 106 struct processor * next; 139 107 struct processor * prev; … … 182 150 183 151 // Link lists fields 184 struct __dbg_node_cltr{152 struct { 185 153 cluster * next; 186 154 cluster * prev;
Note:
See TracChangeset
for help on using the changeset viewer.