Преглед на файлове

More c99 bool declarations and a couple comments

ahc_fix_select
tedbullock преди 17 години
родител
ревизия
ea6dea4f37
променени са 1 файла, в които са добавени 15 реда и са изтрити 5 реда
  1. +15
    -5
      httperf/src/timer.c

+ 15
- 5
httperf/src/timer.c Целия файл

@@ -169,7 +169,10 @@ timer_free_all(void)
persistent_timers = NULL;
}

static int
/*
* Checks whether a timer has expired
*/
static bool
timer_has_expired(Any_Type a)
{
struct Timer *t = a.vp;
@@ -181,13 +184,14 @@ timer_has_expired(Any_Type a)
if (t->time_started + t->timeout_delay < timer_now()) {
t->has_expired = true;
(*t->timeout_callback) (t, t->timer_subject);
return 1;
return true;
}
} else
return 0;
}

return false;
}

static int
static bool
timer_deactivate(Any_Type a)
{
struct Timer *t = a.vp;
@@ -212,6 +216,12 @@ timer_tick(void)
list_remove_if_true(active_timers, &timer_deactivate);
}

/*
* Schedules a timer into the active_timer list. Usually the timer is
* requisitioned from the passive_timer list to avoid making extra calls
* to malloc, but will allocate memory for a new counter if there are no
* inactive timers available
*/
struct Timer *
timer_schedule(void (*timeout) (struct Timer * t, Any_Type arg),
Any_Type subject, Time delay)


Зареждане…
Отказ
Запис