Add finalize method to ensure ending thread.
Merge remote-tracking branch 'origin/riversyang'