Use reentrant lock