Changeset 94b1022a for src/libcfa/concurrency/kernel
- Timestamp:
- May 30, 2018, 9:28:18 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- bd946e4
- Parents:
- 35718a9 (diff), ae32d96 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel
r35718a9 r94b1022a 23 23 extern "C" { 24 24 #include <pthread.h> 25 #include <semaphore.h> 25 26 } 26 27 … … 43 44 extern struct cluster * mainCluster; 44 45 45 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule }; 46 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule, Release_Multi, Release_Multi_Schedule, Callback }; 47 48 typedef void (*__finish_callback_fptr_t)(void); 46 49 47 50 //TODO use union, many of these fields are mutually exclusive (i.e. MULTI vs NOMULTI) 48 51 struct FinishAction { 49 52 FinishOpCode action_code; 53 /* 54 // Union of possible actions 55 union { 56 // Option 1 : locks and threads 57 struct { 58 // 1 thread or N thread 59 union { 60 thread_desc * thrd; 61 struct { 62 thread_desc ** thrds; 63 unsigned short thrd_count; 64 }; 65 }; 66 // 1 lock or N lock 67 union { 68 __spinlock_t * lock; 69 struct { 70 __spinlock_t ** locks; 71 unsigned short lock_count; 72 }; 73 }; 74 }; 75 // Option 2 : action pointer 76 __finish_callback_fptr_t callback; 77 }; 78 /*/ 50 79 thread_desc * thrd; 80 thread_desc ** thrds; 81 unsigned short thrd_count; 51 82 __spinlock_t * lock; 52 83 __spinlock_t ** locks; 53 84 unsigned short lock_count; 54 thread_desc ** thrds;55 unsigned short thrd_count;85 __finish_callback_fptr_t callback; 86 //*/ 56 87 }; 57 88 static inline void ?{}(FinishAction & this) { … … 101 132 102 133 // Idle lock 134 sem_t idleLock; 103 135 104 136 // Link lists fields
Note:
See TracChangeset
for help on using the changeset viewer.