db/simple: use class ScopeDatabaseLock
This commit is contained in:
@@ -80,9 +80,11 @@ UpdateService::CancelMount(const char *uri)
|
||||
/* determine which (mounted) database will be updated and what
|
||||
storage will be scanned */
|
||||
|
||||
db_lock();
|
||||
const auto lr = db.GetRoot().LookupDirectory(uri);
|
||||
db_unlock();
|
||||
Directory::LookupResult lr;
|
||||
{
|
||||
const ScopeDatabaseLock protect;
|
||||
lr = db.GetRoot().LookupDirectory(uri);
|
||||
}
|
||||
|
||||
if (!lr.directory->IsMount())
|
||||
return;
|
||||
@@ -188,9 +190,12 @@ UpdateService::Enqueue(const char *path, bool discard)
|
||||
SimpleDatabase *db2;
|
||||
Storage *storage2;
|
||||
|
||||
db_lock();
|
||||
const auto lr = db.GetRoot().LookupDirectory(path);
|
||||
db_unlock();
|
||||
Directory::LookupResult lr;
|
||||
{
|
||||
const ScopeDatabaseLock protect;
|
||||
lr = db.GetRoot().LookupDirectory(path);
|
||||
}
|
||||
|
||||
if (lr.directory->IsMount()) {
|
||||
/* follow the mountpoint, update the mounted
|
||||
database */
|
||||
|
Reference in New Issue
Block a user