Changeset 5c1a531 for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Apr 11, 2019, 10:36:13 AM (5 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:
- 3c06bba
- Parents:
- e8e457e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
re8e457e r5c1a531 91 91 92 92 void ?{}( coroutine_desc & this, current_stack_info_t * info) with( this ) { 93 context.errno_ = 0;94 93 stack.storage = info->storage; 95 94 with(*stack.storage) { … … 237 236 } 238 237 238 static int * __volatile_errno() __attribute__((noinline)); 239 static int * __volatile_errno() { asm(""); return &errno; } 240 239 241 // KERNEL ONLY 240 242 // runThread runs a thread by context switching … … 271 273 thrd_src->state = thrd_src->state == Halted ? Halted : Inactive; 272 274 proc_cor->state = Active; 275 int local_errno = *__volatile_errno(); 273 276 274 277 // set new coroutine that the processor is executing … … 280 283 proc_cor->state = proc_cor->state == Halted ? Halted : Inactive; 281 284 thrd_src->state = Active; 285 *__volatile_errno() = local_errno; 282 286 } 283 287 … … 380 384 src->state = src->state == Halted ? Halted : Inactive; 381 385 382 // SKULLDUGGERY normally interrupts are enable before leaving a coroutine ctxswitch.383 // Therefore, when first creating a coroutine, interrupts are enable before calling the main.384 // This is consistent with thread creation. However, when creating the main processor coroutine,385 // we wan't interrupts to be disabled. Therefore, we double-disable interrupts here so they will386 // stay disabled.387 disable_interrupts();388 389 386 // context switch to specified coroutine 390 387 verify( dst->context.SP );
Note: See TracChangeset
for help on using the changeset viewer.