aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag_pool.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-07 19:14:45 +0200
committerMax Kellermann <max@duempel.org>2008-09-07 19:14:45 +0200
commit3c4de5b560691bb877d47f475932b3c8f5751b93 (patch)
treeed688ef3f13c12d9c4a4b54c0592b873c92d2b48 /src/tag_pool.c
parent194c8c3c0fc92e5d781a6cc23252a701c84bb380 (diff)
downloadmpd-3c4de5b560691bb877d47f475932b3c8f5751b93.tar.gz
mpd-3c4de5b560691bb877d47f475932b3c8f5751b93.tar.xz
mpd-3c4de5b560691bb877d47f475932b3c8f5751b93.zip
tag: lock all accesses to tag_pool
The tag pool is a shared global resource that is infrequently modified. However, it can occasionally be modified by several threads, especially by the metadata_pipe for streaming metadata (both reading/writing). The bulk tag_item pool is NOT locked as currently only the update thread uses it.
Diffstat (limited to 'src/tag_pool.c')
-rw-r--r--src/tag_pool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tag_pool.c b/src/tag_pool.c
index 89efef1fc..d227a2988 100644
--- a/src/tag_pool.c
+++ b/src/tag_pool.c
@@ -19,6 +19,8 @@
#include "tag_pool.h"
#include "utils.h"
+pthread_mutex_t tag_pool_lock = PTHREAD_MUTEX_INITIALIZER;
+
#define NUM_SLOTS 4096
struct slot {