Changes in src/libcfa/concurrency/kernel [eafb094:9e45e46]
- File:
-
- 1 edited
-
src/libcfa/concurrency/kernel (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel
reafb094 r9e45e46 9 9 // 10 10 // Author : Thierry Delisle 11 // Created On : Tue Jan 17 12:27:26 201 711 // Created On : Tue Jan 17 12:27:26 2016 12 12 // Last Modified By : Thierry Delisle 13 13 // Last Modified On : -- … … 27 27 28 28 //----------------------------------------------------------------------------- 29 // Locks30 void lock( spinlock * );31 void unlock( spinlock * );32 33 void wait( signal_once * );34 void signal( signal_once * );35 36 //-----------------------------------------------------------------------------37 29 // Cluster 38 30 struct cluster { 39 31 simple_thread_list ready_queue; 40 spinlocklock;32 // pthread_spinlock_t lock; 41 33 }; 42 34 … … 46 38 //----------------------------------------------------------------------------- 47 39 // Processor 48 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule }; 49 struct FinishAction { 50 FinishOpCode action_code; 51 thread * thrd; 52 spinlock * lock; 40 enum ProcessorAction { 41 Reschedule, 42 NoAction 53 43 }; 54 static inline void ?{}(FinishAction * this) {55 this->action_code = No_Action;56 this->thrd = NULL;57 this->lock = NULL;58 }59 static inline void ^?{}(FinishAction * this) {}60 44 61 45 struct processor { … … 65 49 thread * current_thread; 66 50 pthread_t kernel_thread; 67 68 signal_once terminated; 69 volatile bool is_terminated; 70 71 struct FinishAction finish; 51 simple_lock lock; 52 volatile bool terminated; 53 ProcessorAction thread_action; 72 54 }; 73 55 … … 75 57 void ?{}(processor * this, cluster * cltr); 76 58 void ^?{}(processor * this); 59 60 61 //----------------------------------------------------------------------------- 62 // Locks 63 64 void ?{}(simple_lock * this); 65 void ^?{}(simple_lock * this); 66 67 void lock( simple_lock * ); 68 void unlock( simple_lock * ); 77 69 78 70 #endif //KERNEL_H
Note:
See TracChangeset
for help on using the changeset viewer.