[update] clean code
[update] fix thread join, fd issue