@@ -176,7 +176,7 @@ timer_enqueue_bucket(timer_root_s *root, timer_s *timer, time_t sec, long nsec)
176176 timer_bucket -> sec , timer_bucket -> nsec /1000 );
177177#endif
178178
179- INSERT :
179+ INSERT :
180180 timer -> timer_bucket = timer_bucket ;
181181 CIRCLEQ_INSERT_TAIL (& timer_bucket -> timer_qhead , timer , timer_qnode );
182182 timer_bucket -> timers ++ ;
@@ -196,9 +196,7 @@ timer_dequeue_bucket(timer_s *timer)
196196 timer_bucket -> timers -- ;
197197 timer -> timer_bucket = NULL ;
198198
199- /*
200- * Defer deleting empty buckets to timer_process_changes().
201- */
199+ /* Defer deleting empty buckets to timer_process_changes(). */
202200}
203201
204202static void
@@ -350,9 +348,7 @@ timer_process_changes(timer_root_s *root)
350348 struct timespec now ;
351349 clock_gettime (CLOCK_MONOTONIC , & now );
352350
353- /*
354- * First work the chnaged timer list.
355- */
351+ /* First process the changed timers list. */
356352 while (!CIRCLEQ_EMPTY (& root -> timer_change_qhead )) {
357353 timer = CIRCLEQ_FIRST (& root -> timer_change_qhead );
358354 timer_bucket = timer -> timer_bucket ;
@@ -380,25 +376,20 @@ timer_process_changes(timer_root_s *root)
380376 }
381377 }
382378
383- /*
384- * Some buckets may be empty by now.
385- * Trash them here where it is safe.
386- */
379+ /* Some buckets may be empty by now.
380+ * Trash them here where it is safe. */
387381 CIRCLEQ_FOREACH_SAFE (timer_bucket , & root -> timer_bucket_qhead ,
388- timer_bucket_qnode , timer_bucket_next ) {
389-
390- /* If the bucket is empty, remove it. */
391- if (!timer_bucket -> timers ) {
392- CIRCLEQ_REMOVE (& root -> timer_bucket_qhead , timer_bucket , timer_bucket_qnode );
393-
382+ timer_bucket_qnode , timer_bucket_next ) {
383+ /* If the bucket is empty, remove it. */
384+ if (!timer_bucket -> timers ) {
385+ CIRCLEQ_REMOVE (& root -> timer_bucket_qhead , timer_bucket , timer_bucket_qnode );
394386#ifdef BNGBLASTER_TIMER_LOGGING
395- LOG (TIMER_DETAIL , " Delete timer bucket %lu.%06lus\n" ,
396- timer_bucket -> sec , timer_bucket -> nsec /1000 );
387+ LOG (TIMER_DETAIL , " Delete timer bucket %lu.%06lus\n" ,
388+ timer_bucket -> sec , timer_bucket -> nsec /1000 );
397389#endif
398-
399- free (timer_bucket );
400- root -> buckets -- ;
401- }
390+ free (timer_bucket );
391+ root -> buckets -- ;
392+ }
402393 }
403394}
404395
0 commit comments