Review: Refine the return code of thread functions.