Add a worker lock for fix data race warning