aboutsummaryrefslogtreecommitdiffstats
path: root/src/update_walk.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-06-13 21:23:34 +0200
committerMax Kellermann <max@duempel.org>2012-06-13 21:26:32 +0200
commit9f3db5a70b4181fef6a70ef84b70fdd5b3c3e451 (patch)
tree2e98f6d2adb18cb97320a4622bd5869d42a34c69 /src/update_walk.c
parent1a59730782bffe91d4d136cee5c65f9f5726bb75 (diff)
downloadmpd-9f3db5a70b4181fef6a70ef84b70fdd5b3c3e451.tar.gz
mpd-9f3db5a70b4181fef6a70ef84b70fdd5b3c3e451.tar.xz
mpd-9f3db5a70b4181fef6a70ef84b70fdd5b3c3e451.zip
directory: require db lock for _{add,remove}_song()
Diffstat (limited to 'src/update_walk.c')
-rw-r--r--src/update_walk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/update_walk.c b/src/update_walk.c
index 0fcfaf37e..6a953f522 100644
--- a/src/update_walk.c
+++ b/src/update_walk.c
@@ -236,7 +236,10 @@ update_archive_tree(struct directory *directory, char *name)
if (song == NULL) {
song = song_file_load(name, directory);
if (song != NULL) {
+ db_lock();
directory_add_song(directory, song);
+ db_unlock();
+
modified = true;
g_message("added %s/%s",
directory_get_path(directory), name);
@@ -374,7 +377,9 @@ update_container_file(struct directory *directory,
&add_tag_handler, song->tag);
g_free(child_path_fs);
+ db_lock();
directory_add_song(contdir, song);
+ db_unlock();
modified = true;
@@ -438,7 +443,10 @@ update_song_file(struct directory *directory,
return;
}
+ db_lock();
directory_add_song(directory, song);
+ db_unlock();
+
modified = true;
g_message("added %s/%s",
directory_get_path(directory), name);