void *beheader(void *arg) { struct list *l = (struct list *)arg; srand(time(0) + 4); while (1) { if (l->head != NULL) list_delete_node(l, l->head); usleep(50); } }