- File:
-
- 1 edited
-
libcfa/src/concurrency/alarm.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/alarm.cfa
re84ab3d rafd7faf 51 51 //============================================================================================= 52 52 53 void ?{}( alarm_node_t & this, thread$* thrd, Duration alarm, Duration period) with( this ) {53 void ?{}( alarm_node_t & this, $thread * thrd, Duration alarm, Duration period) with( this ) { 54 54 this.initial = alarm; 55 55 this.period = period; 56 56 this.thrd = thrd; 57 this.timeval = __kernel_get_time() + alarm;58 57 set = false; 59 58 type = User; … … 64 63 this.period = period; 65 64 this.proc = proc; 66 this.timeval = __kernel_get_time() + alarm;67 65 set = false; 68 66 type = Kernel; 69 67 } 70 68 void ?{}( alarm_node_t & this, Alarm_Callback callback, Duration alarm, Duration period ) with( this ) { 71 this.callback = callback;72 69 this.initial = alarm; 73 70 this.period = period; 74 this. timeval = __kernel_get_time() + alarm;71 this.callback = callback; 75 72 set = false; 76 73 type = Callback; … … 113 110 lock( event_kernel->lock __cfaabi_dbg_ctx2 ); 114 111 { 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();118 117 __cfadbg_print_safe( preemption, " KERNEL: alarm inserting %p (%lu -> %lu).\n", this, curr.tn, this->timeval.tn ); 119 118 insert( &alarms, this ); 120 __kernel_set_timer( this-> timeval - curr);119 __kernel_set_timer( this->initial ); 121 120 this->set = true; 122 121 }
Note:
See TracChangeset
for help on using the changeset viewer.