replace list with dlist in thread list, free stack after thread exit