Changeset 0f1fb78 for libcfa/src
- Timestamp:
- May 15, 2021, 4:39:51 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a6a4dbd
- Parents:
- 9449085
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/alarm.cfa
r9449085 r0f1fb78 55 55 this.period = period; 56 56 this.thrd = thrd; 57 this.timeval = __kernel_get_time() + alarm; 57 58 set = false; 58 59 type = User; … … 63 64 this.period = period; 64 65 this.proc = proc; 66 this.timeval = __kernel_get_time() + alarm; 65 67 set = false; 66 68 type = Kernel; 67 69 } 68 70 void ?{}( alarm_node_t & this, Alarm_Callback callback, Duration alarm, Duration period ) with( this ) { 71 this.callback = callback; 69 72 this.initial = alarm; 70 73 this.period = period; 71 this. callback = callback;74 this.timeval = __kernel_get_time() + alarm; 72 75 set = false; 73 76 type = Callback; … … 110 113 lock( event_kernel->lock __cfaabi_dbg_ctx2 ); 111 114 { 112 Time curr = __kernel_get_time();113 this->timeval = curr + this->initial;114 115 115 /* paranoid */ verify( validate( alarms ) ); 116 116 117 Time curr = __kernel_get_time(); 117 118 __cfadbg_print_safe( preemption, " KERNEL: alarm inserting %p (%lu -> %lu).\n", this, curr.tn, this->timeval.tn ); 118 119 insert( &alarms, this ); 119 __kernel_set_timer( this-> initial);120 __kernel_set_timer( this->timeval - curr); 120 121 } 121 122 unlock( event_kernel->lock );
Note: See TracChangeset
for help on using the changeset viewer.