static void unlink_message (THREAD **top, THREAD *cur)
static void unlink_message (THREAD **old, THREAD *cur)
static void unlink_message (THREAD **top, THREAD *cur){  if (cur->prev)  {    cur->prev->next = cur->next;    if (cur->next)      cur->next->prev = cur->prev;  }  else  {    if (cur->next)      cur->next->prev = NULL;    *top = cur->next;  }}