diff options
author | Max Kellermann <max@duempel.org> | 2012-02-13 19:25:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-02-13 19:26:04 +0100 |
commit | 5ee3a9a9cad4436b99b56ea6336cbfa91fe7a967 (patch) | |
tree | efe0b9748ae98f73474024b8e2100c98e2c870b4 /src/update_walk.c | |
parent | dd26fa67f2c7189636e867710d3c94f93296557f (diff) | |
download | mpd-5ee3a9a9cad4436b99b56ea6336cbfa91fe7a967.tar.gz mpd-5ee3a9a9cad4436b99b56ea6336cbfa91fe7a967.tar.xz mpd-5ee3a9a9cad4436b99b56ea6336cbfa91fe7a967.zip |
playlist_vector: require database lock for all functions
Diffstat (limited to '')
-rw-r--r-- | src/update_walk.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/update_walk.c b/src/update_walk.c index ba92cbc48..003807da6 100644 --- a/src/update_walk.c +++ b/src/update_walk.c @@ -162,8 +162,11 @@ removeDeletedFromDirectory(struct directory *directory) struct playlist_metadata *pm, *np; directory_for_each_playlist_safe(pm, np, directory) { - if (!directory_child_is_regular(directory, pm->name)) + if (!directory_child_is_regular(directory, pm->name)) { + db_lock(); playlist_vector_remove(&directory->playlists, pm->name); + db_unlock(); + } } } @@ -467,9 +470,11 @@ update_regular_file(struct directory *directory, #endif } else if (playlist_suffix_supported(suffix)) { + db_lock(); if (playlist_vector_update_or_add(&directory->playlists, name, st->st_mtime)) modified = true; + db_unlock(); } } |