- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.cfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r3ea8ad1 rac12f1f 251 251 /* paranoid */ verify( ! __preemption_enabled() ); 252 252 /* paranoid */ verify( kernelTLS().this_thread == thrd_dst ); 253 /* paranoid */ verify( thrd_dst->curr_cluster == this->cltr );254 253 /* paranoid */ verify( thrd_dst->context.SP ); 255 254 /* paranoid */ verify( thrd_dst->state != Halted ); … … 268 267 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); 269 268 /* paranoid */ verify( thrd_dst->context.SP ); 270 /* paranoid */ verify( thrd_dst->curr_cluster == this->cltr );271 269 /* paranoid */ verify( kernelTLS().this_thread == thrd_dst ); 272 270 /* paranoid */ verify( ! __preemption_enabled() ); … … 288 286 } 289 287 290 if(unlikely(thrd_dst->state == Halt ing)) {288 if(unlikely(thrd_dst->state == Halted)) { 291 289 // The thread has halted, it should never be scheduled/run again 292 290 // finish the thread … … 362 360 void __schedule_thread( $thread * thrd ) { 363 361 /* paranoid */ verify( ! __preemption_enabled() ); 364 /* paranoid */ verify( kernelTLS().this_proc_id );365 362 /* paranoid */ verify( thrd ); 366 363 /* paranoid */ verify( thrd->state != Halted ); 367 /* paranoid */ verify( thrd->curr_cluster);364 /* paranoid */ verify( kernelTLS().this_proc_id ); 368 365 /* paranoid */ #if defined( __CFA_WITH_VERIFY__ ) 369 366 /* paranoid */ if( thrd->state == Blocked || thrd->state == Start ) assertf( thrd->preempted == __NO_PREEMPTION, … … 476 473 disable_interrupts(); 477 474 475 thrd->state = Halted; 476 if( TICKET_RUNNING != thrd->ticket ) { abort( "Thread terminated with pending unpark" ); } 477 if( thrd != this->owner || this->recursion != 1) { abort( "Thread internal monitor has unbalanced recursion" ); } 478 479 // Leave the thread 478 480 /* paranoid */ verify( ! __preemption_enabled() ); 479 /* paranoid */ verify( thrd->state == Active );480 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary );481 /* paranoid */ verify( kernelTLS().this_thread == thrd );482 /* paranoid */ verify( thrd->context.SP );483 /* paranoid */ verifyf( ((uintptr_t)thrd->context.SP) > ((uintptr_t)__get_stack(thrd->curr_cor)->limit), "ERROR : $thread %p has been corrupted.\n StackPointer too large.\n", thrd );484 /* paranoid */ verifyf( ((uintptr_t)thrd->context.SP) < ((uintptr_t)__get_stack(thrd->curr_cor)->base ), "ERROR : $thread %p has been corrupted.\n StackPointer too small.\n", thrd );485 486 thrd->state = Halting;487 if( TICKET_RUNNING != thrd->ticket ) { abort( "Thread terminated with pending unpark" ); }488 if( thrd != this->owner ) { abort( "Thread internal monitor has incorrect owner" ); }489 if( this->recursion != 1) { abort( "Thread internal monitor has unbalanced recursion" ); }490 491 // Leave the thread492 481 returnToKernel(); 482 abort(); 493 483 494 484 // Control flow should never reach here! 495 abort();496 485 } 497 486 }
Note:
See TracChangeset
for help on using the changeset viewer.