Removes thread.