Ignore:
File:
1 edited

Legend:

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

    r4b30e8cc re873838  
    3838// FwdDeclarations : timeout handlers
    3939static void preempt( processor   * this );
    40 static void timeout( struct __processor_id_t * id, $thread * this );
     40static void timeout( $thread * this );
    4141
    4242// FwdDeclarations : Signal handlers
     
    9191
    9292// Tick one frame of the Discrete Event Simulation for alarms
    93 static void tick_preemption( struct __processor_id_t * id ) {
     93static void tick_preemption(void) {
    9494        alarm_node_t * node = 0p;                                                       // Used in the while loop but cannot be declared in the while condition
    9595        alarm_list_t * alarms = &event_kernel->alarms;          // Local copy for ease of reading
     
    105105
    106106                // Check if this is a kernel
    107                 if( node->type == Kernel ) {
     107                if( node->kernel_alarm ) {
    108108                        preempt( node->proc );
    109109                }
    110                 else if( node->type == User ) {
    111                         timeout( id, node->thrd );
    112                 }
    113110                else {
    114                         bool unpark_thd = node->callback(*node);
    115                         if (unpark_thd) timeout( id, node->thrd );
     111                        timeout( node->thrd );
    116112                }
    117113
     
    274270
    275271// reserved for future use
    276 static void timeout( struct __processor_id_t * id, $thread * this ) {
     272static void timeout( $thread * this ) {
    277273        #if !defined( __CFA_NO_STATISTICS__ )
    278274                kernelTLS.this_stats = this->curr_cluster->stats;
    279275        #endif
    280         __unpark( id, this );
     276        unpark( this );
    281277}
    282278
     
    417413        id.full_proc = false;
    418414        id.id = doregister(&id);
     415        kernelTLS.this_proc_id = &id;
    419416
    420417        // Block sigalrms to control when they arrive
     
    462459                        // __cfaabi_dbg_print_safe( "Kernel : Preemption thread tick\n" );
    463460                        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    464                         tick_preemption( &id );
     461                        tick_preemption();
    465462                        unlock( event_kernel->lock );
    466463                        break;
Note: See TracChangeset for help on using the changeset viewer.