fix a incomplete thread lock.