- File:
-
- 1 edited
-
src/libcfa/concurrency/kernel.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel.c
r82c948c rd0a045c7 108 108 void ?{}( thread_desc & this, current_stack_info_t * info) with( this ) { 109 109 self_cor{ info }; 110 curr_cor = &self_cor;111 self_mon.owner = &this;112 self_mon.recursion = 1;113 self_mon_p = &self_mon;114 next = NULL;115 __cfaabi_dbg_debug_do(116 dbg_next = NULL;117 dbg_prev = NULL;118 __cfaabi_dbg_thread_register(&this);119 )120 121 monitors{ &self_mon_p, 1, (fptr_t)0 };122 110 } 123 111 … … 237 225 // from the processor coroutine to the target thread 238 226 void runThread(processor * this, thread_desc * dst) { 239 assert(dst->curr_cor);240 227 coroutine_desc * proc_cor = get_coroutine(*this->runner); 241 coroutine_desc * thrd_cor = dst->curr_cor;228 coroutine_desc * thrd_cor = get_coroutine(dst); 242 229 243 230 //Reset the terminating actions here … … 250 237 ThreadCtxSwitch(proc_cor, thrd_cor); 251 238 // when ThreadCtxSwitch returns we are back in the processor coroutine 252 }253 254 void returnToKernel() {255 coroutine_desc * proc_cor = get_coroutine(*this_processor->runner);256 coroutine_desc * thrd_cor = this_thread->curr_cor = this_coroutine;257 ThreadCtxSwitch(thrd_cor, proc_cor);258 239 } 259 240 … … 379 360 disable_interrupts(); 380 361 verify( !preemption_enabled ); 381 returnToKernel();362 suspend(); 382 363 verify( !preemption_enabled ); 383 364 enable_interrupts( __cfaabi_dbg_ctx ); … … 390 371 391 372 verify( !preemption_enabled ); 392 returnToKernel();373 suspend(); 393 374 verify( !preemption_enabled ); 394 375 … … 402 383 403 384 verify( !preemption_enabled ); 404 returnToKernel();385 suspend(); 405 386 verify( !preemption_enabled ); 406 387 … … 416 397 417 398 verify( !preemption_enabled ); 418 returnToKernel();399 suspend(); 419 400 verify( !preemption_enabled ); 420 401 … … 429 410 430 411 verify( !preemption_enabled ); 431 returnToKernel();412 suspend(); 432 413 verify( !preemption_enabled ); 433 414 … … 444 425 445 426 verify( !preemption_enabled ); 446 returnToKernel();427 suspend(); 447 428 verify( !preemption_enabled ); 448 429 … … 456 437 this_processor->finish.thrd = thrd; 457 438 458 returnToKernel();439 suspend(); 459 440 } 460 441 … … 521 502 // which is currently here 522 503 mainProcessor->do_terminate = true; 523 returnToKernel();504 suspend(); 524 505 525 506 // THE SYSTEM IS NOW COMPLETELY STOPPED
Note:
See TracChangeset
for help on using the changeset viewer.