This would trigger a infinite loop if a timeout expired and the next timeout
was not expired yet, but less than 1 second from being expired.
timeout_t *timeout = timeout_tree.head->data;
timersub(&timeout->tv, &now, &diff);
timeout_t *timeout = timeout_tree.head->data;
timersub(&timeout->tv, &now, &diff);
timeout->cb(timeout->data);
if(timercmp(&timeout->tv, &now, <))
timeout_del(timeout);
timeout->cb(timeout->data);
if(timercmp(&timeout->tv, &now, <))
timeout_del(timeout);