finish pthread