Reentrant lock should be used