Fix threadpool's bugs for Reentrancy.
Fix threadpool's bugs for Reentrancy and delete object.