Changeset 8c01e1b for libcfa/src
- Timestamp:
- Apr 4, 2019, 5:28:47 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 211228e0
- Parents:
- b2f6113
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
rb2f6113 r8c01e1b 68 68 69 69 void ^?{}(__stack_info_t & this) { 70 if ( ! this.userStack && this.storage ) { 71 void * storage = (char*)(this.storage) - this.storage->size; 70 bool userStack = ((intptr_t)this.storage & 0x1) != 0; 71 if ( ! userStack && this.storage ) { 72 *((intptr_t*)&this.storage) &= (intptr_t)-1; 73 void * storage = this.storage->limit; 72 74 __cfaabi_dbg_debug_do( 73 75 storage = (char*)(storage) - __page_size; … … 200 202 this->storage->limit = storage; 201 203 this->storage->base = (void*)((intptr_t)storage + size); 202 this->userStack = userStack;204 *((intptr_t*)&this->storage) |= userStack ? 0x1 : 0x0; 203 205 } 204 206 -
libcfa/src/concurrency/coroutine.hfa
rb2f6113 r8c01e1b 102 102 coroutine_desc * dst = get_coroutine(cor); 103 103 104 if( unlikely( !dst->stack.storage || !dst->stack.storage->base) ) {104 if( unlikely(dst->context.SP == NULL) ) { 105 105 __stack_prepare(&dst->stack, 65000); 106 106 CtxStart(&cor, CtxInvokeCoroutine); -
libcfa/src/concurrency/invoke.h
rb2f6113 r8c01e1b 97 97 // pointer to stack 98 98 struct __stack_t * storage; 99 100 // whether or not the user allocated the stack101 bool userStack;102 99 }; 103 100 -
libcfa/src/concurrency/kernel.cfa
rb2f6113 r8c01e1b 94 94 context.errno_ = 0; 95 95 stack.storage = info->storage; 96 stack.userStack = true;97 96 with(*stack.storage) { 98 97 size = info->size; … … 100 99 base = info->base; 101 100 } 101 *((intptr_t*)&stack.storage) |= 0x1; 102 102 name = "Main Thread"; 103 103 state = Start;
Note: See TracChangeset
for help on using the changeset viewer.