timeout
timeout copied to clipboard
add debug interface timeouts_pendings()
Sometimes I want to check the value of pending field of struct timeouts for debug, then I implement this function.In my other c file, I can use it as this:
void logPendings(struct timeouts *T)
{
int i;
uint64_t *pendings;
int wheel = timeouts_pendings(T, &pendings);
for (i = 0; i < wheel; ++i) {
printf("%016llx \n", pendings[i]);
}
printf("\n");
free(pendings);
}