- File:
-
- 1 edited
-
libcfa/src/concurrency/preemption.cfa (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r8e9e9a2 rc1ee231 37 37 // FwdDeclarations : timeout handlers 38 38 static void preempt( processor * this ); 39 static void timeout( struct __processor_id_t * id,$thread * this );39 static void timeout( $thread * this ); 40 40 41 41 // FwdDeclarations : Signal handlers … … 88 88 89 89 // Tick one frame of the Discrete Event Simulation for alarms 90 static void tick_preemption( struct __processor_id_t * id) {90 static void tick_preemption() { 91 91 alarm_node_t * node = 0p; // Used in the while loop but cannot be declared in the while condition 92 92 alarm_list_t * alarms = &event_kernel->alarms; // Local copy for ease of reading … … 106 106 } 107 107 else { 108 timeout( id,node->thrd );108 timeout( node->thrd ); 109 109 } 110 110 … … 119 119 // If there are still alarms pending, reset the timer 120 120 if( & (*alarms)`first ) { 121 __cfa dbg_print_buffer_decl(preemption," KERNEL: @%ju(%ju) resetting alarm to %ju.\n", currtime.tv, __kernel_get_time().tv, (alarms->head->alarm - currtime).tv);121 __cfaabi_dbg_print_buffer_decl( " KERNEL: @%ju(%ju) resetting alarm to %ju.\n", currtime.tv, __kernel_get_time().tv, (alarms->head->alarm - currtime).tv); 122 122 Duration delta = (*alarms)`first.alarm - currtime; 123 123 Duration capped = max(delta, 50`us); … … 186 186 void enable_interrupts( __cfaabi_dbg_ctx_param ) { 187 187 processor * proc = kernelTLS.this_processor; // Cache the processor now since interrupts can start happening after the atomic store 188 /* paranoid */ verify( proc );189 188 190 189 with( kernelTLS.preemption_state ){ … … 267 266 268 267 // reserved for future use 269 static void timeout( struct __processor_id_t * id, $thread * this ) { 270 #if !defined( __CFA_NO_STATISTICS__ ) 271 kernelTLS.this_stats = this->curr_cluster->stats; 272 #endif 273 __unpark( id, this __cfaabi_dbg_ctx2 ); 268 static void timeout( $thread * this ) { 269 __unpark( this __cfaabi_dbg_ctx2 ); 274 270 } 275 271 … … 407 403 // Waits on SIGALRM and send SIGUSR1 to whom ever needs it 408 404 static void * alarm_loop( __attribute__((unused)) void * args ) { 409 __processor_id_t id;410 id.id = doregister(&id);411 412 405 // Block sigalrms to control when they arrive 413 406 sigset_t mask; … … 454 447 // __cfaabi_dbg_print_safe( "Kernel : Preemption thread tick\n" ); 455 448 lock( event_kernel->lock __cfaabi_dbg_ctx2 ); 456 tick_preemption( &id);449 tick_preemption(); 457 450 unlock( event_kernel->lock ); 458 451 break; … … 467 460 EXIT: 468 461 __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" ); 469 unregister(&id);470 462 return 0p; 471 463 }
Note:
See TracChangeset
for help on using the changeset viewer.