Changeset 17af7d1 for src/libcfa/concurrency/invoke.h
- Timestamp:
- Mar 17, 2017, 11:34:15 AM (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:
- b32ada31
- Parents:
- 9f1695b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/invoke.h
r9f1695b r17af7d1 28 28 #define unlikely(x) __builtin_expect(!!(x), 0) 29 29 #define thread_local _Thread_local 30 #define SCHEDULER_CAPACITY 1031 30 32 31 struct spinlock { … … 60 59 61 60 struct coStack_t { 62 unsigned int size; 63 void *storage; 64 void *limit; 65 void *base; 66 void *context; 67 void *top; 68 bool userStack; 61 unsigned int size; // size of stack 62 void *storage; // pointer to stack 63 void *limit; // stack grows towards stack limit 64 void *base; // base of stack 65 void *context; // address of cfa_context_t 66 void *top; // address of top of storage 67 bool userStack; // whether or not the user allocated the stack 69 68 }; 70 69 … … 72 71 73 72 struct coroutine_desc { 74 struct coStack_t stack; 75 const char *name; 76 int errno_; 77 enum coroutine_state state; 78 struct coroutine_desc *starter; 79 struct coroutine_desc *last; 73 struct coStack_t stack; // stack information of the coroutine 74 const char *name; // textual name for coroutine/task, initialized by uC++ generated code 75 int errno_; // copy of global UNIX variable errno 76 enum coroutine_state state; // current execution status for coroutine 77 struct coroutine_desc *starter; // first coroutine to resume this one 78 struct coroutine_desc *last; // last coroutine to resume this one 80 79 }; 81 80 82 81 struct thread_desc { 83 struct coroutine_desc c ;// coroutine body used to store context82 struct coroutine_desc cor; // coroutine body used to store context 84 83 struct signal_once terminated; // indicate if execuation state is not halted 85 struct thread_desc * next; 84 struct thread_desc * next; // instrusive link field for threads 86 85 }; 87 86
Note: See TracChangeset
for help on using the changeset viewer.