Changeset 254ad1b
- Timestamp:
- Apr 24, 2021, 7:24:09 PM (2 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a76efc8, cfff639
- Parents:
- 734908c
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r734908c r254ad1b 349 349 if(unlikely(thrd_dst->preempted != __NO_PREEMPTION)) { 350 350 // The thread was preempted, reschedule it and reset the flag 351 __schedule_thread( thrd_dst );351 schedule_thread$( thrd_dst ); 352 352 break RUNNING; 353 353 } … … 439 439 /* paranoid */ verify( ! __preemption_enabled() ); 440 440 /* paranoid */ verify( kernelTLS().this_proc_id ); 441 /* paranoid */ verify( ready_schedule_islocked()); 441 442 /* paranoid */ verify( thrd ); 442 443 /* paranoid */ verify( thrd->state != Halted ); … … 457 458 struct cluster * cl = thrd->curr_cluster; 458 459 459 ready_schedule_lock(); 460 // push the thread to the cluster ready-queue 461 push( cl, thrd ); 462 463 // variable thrd is no longer safe to use 460 // push the thread to the cluster ready-queue 461 push( cl, thrd ); 462 463 // variable thrd is no longer safe to use 464 464 thrd = 0xdeaddeaddeaddeadp; 465 465 466 // wake the cluster using the save variable. 467 __wake_one( cl ); 468 ready_schedule_unlock(); 466 // wake the cluster using the save variable. 467 __wake_one( cl ); 469 468 470 469 #if !defined(__CFA_NO_STATISTICS__) … … 479 478 #endif 480 479 481 /* paranoid */ verify( ! __preemption_enabled() ); 480 /* paranoid */ verify( ready_schedule_islocked()); 481 /* paranoid */ verify( ! __preemption_enabled() ); 482 } 483 484 void schedule_thread$( $thread * thrd ) { 485 ready_schedule_lock(); 486 __schedule_thread( thrd ); 487 ready_schedule_unlock(); 482 488 } 483 489 … … 532 538 disable_interrupts(); 533 539 // Wake lost the race, 534 __schedule_thread( thrd );540 schedule_thread$( thrd ); 535 541 enable_interrupts(false); 536 542 } -
libcfa/src/concurrency/kernel/startup.cfa
r734908c r254ad1b 225 225 // Add the main thread to the ready queue 226 226 // once resume is called on mainProcessor->runner the mainThread needs to be scheduled like any normal thread 227 __schedule_thread(mainThread);227 schedule_thread$(mainThread); 228 228 229 229 // SKULLDUGGERY: Force a context switch to the main processor to set the main thread's context to the current UNIX -
libcfa/src/concurrency/kernel_private.hfa
r734908c r254ad1b 32 32 } 33 33 34 void __schedule_thread( $thread * ) 35 #if defined(NDEBUG) || (!defined(__CFA_DEBUG__) && !defined(__CFA_VERIFY__)) 36 __attribute__((nonnull (1))) 37 #endif 38 ; 34 void schedule_thread$( $thread * ) __attribute__((nonnull (1))); 39 35 40 36 extern bool __preemption_enabled(); -
libcfa/src/concurrency/thread.cfa
r734908c r254ad1b 134 134 /* paranoid */ verify( this_thrd->context.SP ); 135 135 136 __schedule_thread( this_thrd );136 schedule_thread$( this_thrd ); 137 137 enable_interrupts(); 138 138 }
Note: See TracChangeset
for help on using the changeset viewer.