Changes in / [a6a4dbd:0336e83]


Ignore:
File:
1 edited

Legend:

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

    ra6a4dbd r0336e83  
    5555        this.period  = period;
    5656        this.thrd = thrd;
    57         this.timeval = __kernel_get_time() + alarm;
    5857        set = false;
    5958        type = User;
     
    6463        this.period  = period;
    6564        this.proc = proc;
    66         this.timeval = __kernel_get_time() + alarm;
    6765        set = false;
    6866        type = Kernel;
    6967}
    7068void ?{}( alarm_node_t & this, Alarm_Callback callback, Duration alarm, Duration period ) with( this ) {
    71         this.callback = callback;
    7269        this.initial = alarm;
    7370        this.period  = period;
    74         this.timeval = __kernel_get_time() + alarm;
     71        this.callback = callback;
    7572        set = false;
    7673        type = Callback;
     
    113110        lock( event_kernel->lock __cfaabi_dbg_ctx2 );
    114111        {
     112                Time curr = __kernel_get_time();
     113                this->timeval = curr + this->initial;
     114
    115115                /* paranoid */ verify( validate( alarms ) );
    116116
    117                 Time curr = __kernel_get_time();
    118117                __cfadbg_print_safe( preemption, " KERNEL: alarm inserting %p (%lu -> %lu).\n", this, curr.tn, this->timeval.tn );
    119118                insert( &alarms, this );
    120                 __kernel_set_timer( this->timeval - curr);
     119                __kernel_set_timer( this->initial );
    121120        }
    122121        unlock( event_kernel->lock );
Note: See TracChangeset for help on using the changeset viewer.