Changeset 212c2187 for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Apr 1, 2019, 2:04:14 PM (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:
- 2fabdc02
- Parents:
- b611fc3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rb611fc3 r212c2187 60 60 NULL, 61 61 NULL, 62 NULL,63 62 { 1, false, false } 64 63 }; … … 263 262 static void returnToKernel() { 264 263 coroutine_desc * proc_cor = get_coroutine(kernelTLS.this_processor->runner); 265 coroutine_desc * thrd_cor = kernelTLS.this_thread->curr_cor = kernelTLS.this_coroutine;264 coroutine_desc * thrd_cor = kernelTLS.this_thread->curr_cor; 266 265 ThreadCtxSwitch(thrd_cor, proc_cor); 267 266 } … … 307 306 processor * proc = (processor *) arg; 308 307 kernelTLS.this_processor = proc; 309 kernelTLS.this_coroutine = NULL;310 308 kernelTLS.this_thread = NULL; 311 309 kernelTLS.preemption_state.[enabled, disable_count] = [false, 1]; … … 321 319 322 320 //Set global state 323 kernelTLS.this_coroutine = get_coroutine(proc->runner);324 321 kernelTLS.this_thread = NULL; 325 322 … … 351 348 // KERNEL_ONLY 352 349 void kernel_first_resume(processor * this) { 353 coroutine_desc * src = kernelTLS.this_coroutine;350 coroutine_desc * src = mainThread->curr_cor; 354 351 coroutine_desc * dst = get_coroutine(this->runner); 355 352 … … 366 363 // set state of current coroutine to inactive 367 364 src->state = src->state == Halted ? Halted : Inactive; 368 369 // set new coroutine that task is executing370 kernelTLS.this_coroutine = dst;371 365 372 366 // SKULLDUGGERY normally interrupts are enable before leaving a coroutine ctxswitch. … … 599 593 kernelTLS.this_processor = mainProcessor; 600 594 kernelTLS.this_thread = mainThread; 601 kernelTLS.this_coroutine = &mainThread->self_cor;602 595 603 596 // Enable preemption … … 720 713 __cfaabi_dbg_bits_write( abort_text, len ); 721 714 722 if ( get_coroutine(thrd) != kernelTLS.this_coroutine) {723 len = snprintf( abort_text, abort_text_size, " in coroutine %.256s (%p).\n", kernelTLS.this_coroutine->name, kernelTLS.this_coroutine);715 if ( &thrd->self_cor != thrd->curr_cor ) { 716 len = snprintf( abort_text, abort_text_size, " in coroutine %.256s (%p).\n", thrd->curr_cor->name, thrd->curr_cor ); 724 717 __cfaabi_dbg_bits_write( abort_text, len ); 725 718 }
Note: See TracChangeset
for help on using the changeset viewer.