Changeset d3ab183 for libcfa/src/concurrency/preemption.cfa
- Timestamp:
- May 4, 2020, 8:59:09 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 08a994e, f90d10f
- Parents:
- 4d741e9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r4d741e9 rd3ab183 84 84 // Get next expired node 85 85 static inline alarm_node_t * get_expired( alarm_list_t * alarms, Time currtime ) { 86 if( ! alarms->head) return 0p; // If no alarms return null87 if( alarms->head->alarm >= currtime ) return 0p; // If alarms head not expired return null86 if( ! & (*alarms)`first ) return 0p; // If no alarms return null 87 if( (*alarms)`first.alarm >= currtime ) return 0p; // If alarms head not expired return null 88 88 return pop(alarms); // Otherwise just pop head 89 89 } … … 120 120 121 121 // If there are still alarms pending, reset the timer 122 if( alarms->head) {122 if( & (*alarms)`first ) { 123 123 __cfaabi_dbg_print_buffer_decl( " KERNEL: @%ju(%ju) resetting alarm to %ju.\n", currtime.tv, __kernel_get_time().tv, (alarms->head->alarm - currtime).tv); 124 Duration delta = alarms->head->alarm - currtime;125 Duration cap ed = max(delta, 50`us);124 Duration delta = (*alarms)`first.alarm - currtime; 125 Duration capped = max(delta, 50`us); 126 126 // itimerval tim = { caped }; 127 127 // __cfaabi_dbg_print_buffer_local( " Values are %lu, %lu, %lu %lu.\n", delta.tv, caped.tv, tim.it_value.tv_sec, tim.it_value.tv_usec); 128 128 129 __kernel_set_timer( cap ed );129 __kernel_set_timer( capped ); 130 130 } 131 131 }
Note: See TracChangeset
for help on using the changeset viewer.