a read/write lock
extract common root path impl
isEmpty -> isRoot