Changeset db6f06a for src/libcfa/concurrency/kernel
- Timestamp:
- Feb 13, 2017, 5:04:43 PM (8 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, resolv-new, with_gc
- Children:
- ee897e4b
- Parents:
- 75f3522
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/libcfa/concurrency/kernel ¶
r75f3522 rdb6f06a 27 27 28 28 //----------------------------------------------------------------------------- 29 // Locks 30 // void lock( simple_lock * ); 31 // void lock( simple_lock *, spinlock * ); 32 // void unlock( simple_lock * ); 33 34 void lock( spinlock * ); 35 void unlock( spinlock * ); 36 37 void wait( signal_once * ); 38 void signal( signal_once * ); 39 40 //----------------------------------------------------------------------------- 29 41 // Cluster 30 42 struct cluster { 31 43 simple_thread_list ready_queue; 32 // pthread_spinlock_tlock;44 spinlock lock; 33 45 }; 34 46 … … 38 50 //----------------------------------------------------------------------------- 39 51 // Processor 40 enum ProcessorAction { 41 Reschedule, 42 NoAction 52 enum FinishOpCode { No_Action, Release, Schedule, Release_Schedule }; 53 struct FinishAction { 54 FinishOpCode action_code; 55 thread * thrd; 56 spinlock * lock; 43 57 }; 58 static inline void ?{}(FinishAction * this) { 59 this->action_code = No_Action; 60 this->thrd = NULL; 61 this->lock = NULL; 62 } 63 static inline void ^?{}(FinishAction * this) {} 44 64 45 65 struct processor { … … 49 69 thread * current_thread; 50 70 pthread_t kernel_thread; 51 simple_lock lock; 52 volatile bool terminated; 53 ProcessorAction thread_action; 71 72 signal_once terminated; 73 volatile bool is_terminated; 74 75 struct FinishAction finish; 54 76 }; 55 77 … … 57 79 void ?{}(processor * this, cluster * cltr); 58 80 void ^?{}(processor * this); 59 60 //-----------------------------------------------------------------------------61 // Locks62 63 void ?{}(simple_lock * this);64 void ^?{}(simple_lock * this);65 66 void lock( simple_lock * );67 void unlock( simple_lock * );68 81 69 82 #endif //KERNEL_H
Note: See TracChangeset
for help on using the changeset viewer.