fix thread.error: release unlocked lock