/* Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet.  */
void tls_untimeout_p(u8 timeo_assigned, tls_timeout_handler handler, void *arg)
/* Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet.  */
void tls_untimeout_p(u8 timeo_assigned, tls_timeout_handler handler, void *arg)
{
  struct tls_timeo *prev_t, *t;
  struct tls_timeo **timeo = &next_timeout[timeo_assigned];
  if (*timeo == NULL) {
    return;
  }
  for (t = *timeo, prev_t = NULL; t != NULL; prev_t = t, t = t->next) {
    if ((t->h == handler) && (t->arg == arg)) {
      if (prev_t == NULL) {
        *timeo = t->next;
      } else {
        prev_t->next = t->next;
      }
      if (t->next != NULL) {
        t->next->time += t->time;
      }
      tls_mem_free(t);
      return;
    }
  }
  return;
}