Changeset db6f06a for src/libcfa/concurrency/invoke.h
- Timestamp:
- Feb 13, 2017, 5:04:43 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, resolv-new, with_gc
- Children:
- ee897e4b
- Parents:
- 75f3522
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/invoke.h
r75f3522 rdb6f06a 30 30 #define SCHEDULER_CAPACITY 10 31 31 32 struct spinlock { 33 volatile int lock; 34 }; 35 32 36 struct simple_thread_list { 33 37 struct thread * head; 34 38 struct thread ** tail; 39 }; 40 41 // struct simple_lock { 42 // struct simple_thread_list blocked; 43 // }; 44 45 struct signal_once { 46 volatile bool condition; 47 struct spinlock lock; 48 struct simple_thread_list blocked; 35 49 }; 36 50 … … 40 54 void append( struct simple_thread_list *, struct thread * ); 41 55 struct thread * pop_head( struct simple_thread_list * ); 56 57 // void ?{}(simple_lock * this); 58 // void ^?{}(simple_lock * this); 59 60 void ?{}(spinlock * this); 61 void ^?{}(spinlock * this); 62 63 void ?{}(signal_once * this); 64 void ^?{}(signal_once * this); 42 65 } 43 66 #endif … … 60 83 int errno_; // copy of global UNIX variable errno 61 84 enum coroutine_state state; // current execution status for coroutine 62 bool notHalted; // indicate if execuation state is not halted 63 85 bool notHalted; // indicate if execuation state is not halted 64 86 struct coroutine *starter; // first coroutine to resume this one 65 87 struct coroutine *last; // last coroutine to resume this one 66 88 }; 67 89 68 struct simple_lock {69 struct simple_thread_list blocked;70 };71 72 90 struct thread { 73 91 struct coroutine c; 74 s truct simple_lock lock;92 signal_once terminated; // indicate if execuation state is not halted 75 93 struct thread * next; 76 94 };
Note: See TracChangeset
for help on using the changeset viewer.