Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/preemption.cfa

    r8e9e9a2 rc1ee231  
    3737// FwdDeclarations : timeout handlers
    3838static void preempt( processor   * this );
    39 static void timeout( struct __processor_id_t * id, $thread * this );
     39static void timeout( $thread * this );
    4040
    4141// FwdDeclarations : Signal handlers
     
    8888
    8989// Tick one frame of the Discrete Event Simulation for alarms
    90 static void tick_preemption( struct __processor_id_t * id ) {
     90static void tick_preemption() {
    9191        alarm_node_t * node = 0p;                                                       // Used in the while loop but cannot be declared in the while condition
    9292        alarm_list_t * alarms = &event_kernel->alarms;          // Local copy for ease of reading
     
    106106                }
    107107                else {
    108                         timeout( id, node->thrd );
     108                        timeout( node->thrd );
    109109                }
    110110
     
    119119        // If there are still alarms pending, reset the timer
    120120        if( & (*alarms)`first ) {
    121                 __cfadbg_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);
    122122                Duration delta = (*alarms)`first.alarm - currtime;
    123123                Duration capped = max(delta, 50`us);
     
    186186        void enable_interrupts( __cfaabi_dbg_ctx_param ) {
    187187                processor   * proc = kernelTLS.this_processor; // Cache the processor now since interrupts can start happening after the atomic store
    188                 /* paranoid */ verify( proc );
    189188
    190189                with( kernelTLS.preemption_state ){
     
    267266
    268267// 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 );
     268static void timeout( $thread * this ) {
     269        __unpark( this __cfaabi_dbg_ctx2 );
    274270}
    275271
     
    407403// Waits on SIGALRM and send SIGUSR1 to whom ever needs it
    408404static void * alarm_loop( __attribute__((unused)) void * args ) {
    409         __processor_id_t id;
    410         id.id = doregister(&id);
    411 
    412405        // Block sigalrms to control when they arrive
    413406        sigset_t mask;
     
    454447                        // __cfaabi_dbg_print_safe( "Kernel : Preemption thread tick\n" );
    455448                        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    456                         tick_preemption( &id );
     449                        tick_preemption();
    457450                        unlock( event_kernel->lock );
    458451                        break;
     
    467460EXIT:
    468461        __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
    469         unregister(&id);
    470462        return 0p;
    471463}
Note: See TracChangeset for help on using the changeset viewer.