Ignore:
Timestamp:
Sep 29, 2022, 11:33:03 AM (21 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
5f9c42b
Parents:
a659b31
Message:

Added some defensive programming to work around parsing bug

File:
1 edited

Legend:

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

    ra659b31 r1756e08  
    5555        this.period  = period;
    5656        this.thrd = thrd;
    57         this.timeval = __kernel_get_time() + alarm;
     57        this.deadline = __kernel_get_time() + alarm;
    5858        set = false;
    5959        type = User;
     
    6464        this.period  = period;
    6565        this.proc = proc;
    66         this.timeval = __kernel_get_time() + alarm;
     66        this.deadline = __kernel_get_time() + alarm;
    6767        set = false;
    6868        type = Kernel;
     
    7272        this.initial = alarm;
    7373        this.period  = period;
    74         this.timeval = __kernel_get_time() + alarm;
     74        this.deadline = __kernel_get_time() + alarm;
    7575        set = false;
    7676        type = Callback;
     
    8585void insert( alarm_list_t * this, alarm_node_t * n ) {
    8686        alarm_node_t * it = & (*this)`first;
    87         while( it && (n->timeval > it->timeval) ) {
     87        while( it && (n->deadline > it->deadline) ) {
    8888                it = & (*it)`next;
    8989        }
     
    116116
    117117                Time curr = __kernel_get_time();
    118                 __cfadbg_print_safe( preemption, " KERNEL: alarm inserting %p (%lu -> %lu).\n", this, curr.tn, this->timeval.tn );
     118                __cfadbg_print_safe( preemption, " KERNEL: alarm inserting %p (%lu -> %lu).\n", this, curr.tn, this->deadline.tn );
    119119                insert( &alarms, this );
    120                 __kernel_set_timer( this->timeval - curr);
     120                __kernel_set_timer( this->deadline - curr);
    121121                this->set = true;
    122122        }
Note: See TracChangeset for help on using the changeset viewer.