aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/update/UpdateSong.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-31 22:17:49 +0100
committerMax Kellermann <max@duempel.org>2014-01-31 22:17:49 +0100
commit26970579b86c4dfb8e7a11cbc12edac670e4f0e2 (patch)
tree4f859ab8b534fb3d2fc637624cc4c412797a1efd /src/db/update/UpdateSong.cxx
parent04b4f534889719fd822aff5cf9b78a50d1da47ad (diff)
downloadmpd-26970579b86c4dfb8e7a11cbc12edac670e4f0e2.tar.gz
mpd-26970579b86c4dfb8e7a11cbc12edac670e4f0e2.tar.xz
mpd-26970579b86c4dfb8e7a11cbc12edac670e4f0e2.zip
db/update/Editor: add locking method variants
Diffstat (limited to 'src/db/update/UpdateSong.cxx')
-rw-r--r--src/db/update/UpdateSong.cxx18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/db/update/UpdateSong.cxx b/src/db/update/UpdateSong.cxx
index afd609f9a..751d8bfe9 100644
--- a/src/db/update/UpdateSong.cxx
+++ b/src/db/update/UpdateSong.cxx
@@ -42,11 +42,8 @@ UpdateWalk::UpdateSongFile2(Directory &directory,
FormatError(update_domain,
"no read permissions on %s/%s",
directory.GetPath(), name);
- if (song != nullptr) {
- db_lock();
- editor.DeleteSong(directory, song);
- db_unlock();
- }
+ if (song != nullptr)
+ editor.LockDeleteSong(directory, song);
return;
}
@@ -54,11 +51,8 @@ UpdateWalk::UpdateSongFile2(Directory &directory,
if (!(song != nullptr && st->st_mtime == song->mtime &&
!walk_discard) &&
UpdateContainerFile(directory, name, suffix, st)) {
- if (song != nullptr) {
- db_lock();
- editor.DeleteSong(directory, song);
- db_unlock();
- }
+ if (song != nullptr)
+ editor.LockDeleteSong(directory, song);
return;
}
@@ -88,9 +82,7 @@ UpdateWalk::UpdateSongFile2(Directory &directory,
FormatDebug(update_domain,
"deleting unrecognized file %s/%s",
directory.GetPath(), name);
- db_lock();
- editor.DeleteSong(directory, song);
- db_unlock();
+ editor.LockDeleteSong(directory, song);
}
modified = true;