Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9f3db5a7
Commit
9f3db5a7
authored
Jun 13, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: require db lock for _{add,remove}_song()
parent
1a597307
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
directory.c
src/directory.c
+2
-0
update_walk.c
src/update_walk.c
+8
-0
No files found.
src/directory.c
View file @
9f3db5a7
...
...
@@ -186,6 +186,7 @@ directory_lookup_directory(struct directory *directory, const char *uri)
void
directory_add_song
(
struct
directory
*
directory
,
struct
song
*
song
)
{
assert
(
holding_db_lock
());
assert
(
directory
!=
NULL
);
assert
(
song
!=
NULL
);
assert
(
song
->
parent
==
directory
);
...
...
@@ -197,6 +198,7 @@ void
directory_remove_song
(
G_GNUC_UNUSED
struct
directory
*
directory
,
struct
song
*
song
)
{
assert
(
holding_db_lock
());
assert
(
directory
!=
NULL
);
assert
(
song
!=
NULL
);
assert
(
song
->
parent
==
directory
);
...
...
src/update_walk.c
View file @
9f3db5a7
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment