diff options
author | Max Kellermann <max@duempel.org> | 2012-01-24 18:20:58 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-01-24 20:49:53 +0100 |
commit | d99f074eb73d5228528961a78c13419c2c4c26ae (patch) | |
tree | 26749b6a0feb81d1bda7d0e1511d38ba1716cfcd /src/db/simple_db_plugin.c | |
parent | a989140a0767823fcec4ef745b639b92838413f9 (diff) | |
download | mpd-d99f074eb73d5228528961a78c13419c2c4c26ae.tar.gz mpd-d99f074eb73d5228528961a78c13419c2c4c26ae.tar.xz mpd-d99f074eb73d5228528961a78c13419c2c4c26ae.zip |
directory: replace dirvec with doubly linked list
Random access is not needed, and a linked list is easier to manage: we
don't need to (re-)allocate the pointer array.
Diffstat (limited to '')
-rw-r--r-- | src/db/simple_db_plugin.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/db/simple_db_plugin.c b/src/db/simple_db_plugin.c index 7b13d0a26..816f4503b 100644 --- a/src/db/simple_db_plugin.c +++ b/src/db/simple_db_plugin.c @@ -24,6 +24,7 @@ #include "db_selection.h" #include "db_visitor.h" #include "db_save.h" +#include "db_lock.h" #include "conf.h" #include "glib_compat.h" #include "directory.h" @@ -266,8 +267,11 @@ simple_db_visit(struct db *_db, const struct db_selection *selection, !visitor->directory(directory, ctx, error_r)) return false; - return directory_walk(directory, selection->recursive, - visitor, ctx, error_r); + db_lock(); + bool ret = directory_walk(directory, selection->recursive, + visitor, ctx, error_r); + db_unlock(); + return ret; } const struct db_plugin simple_db_plugin = { |