diff options
author | Thomas Jansen <mithi@mithi.net> | 2008-12-28 22:09:42 +0100 |
---|---|---|
committer | Thomas Jansen <mithi@mithi.net> | 2008-12-28 22:09:42 +0100 |
commit | 28128dc4e3c0cd581e868404034aba120c8b56c1 (patch) | |
tree | 3569ab9438b8de85455197fa28d00df067f9b7e3 /src/tag_pool.c | |
parent | ce5c22f4f4b463c11c58de2990b8565c061cf58b (diff) | |
download | mpd-28128dc4e3c0cd581e868404034aba120c8b56c1.tar.gz mpd-28128dc4e3c0cd581e868404034aba120c8b56c1.tar.xz mpd-28128dc4e3c0cd581e868404034aba120c8b56c1.zip |
tag & tag_pool: migrate from pthread to glib threads
Diffstat (limited to '')
-rw-r--r-- | src/tag_pool.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tag_pool.c b/src/tag_pool.c index dc2e0df2b..1c7ae31ab 100644 --- a/src/tag_pool.c +++ b/src/tag_pool.c @@ -21,7 +21,7 @@ #include <assert.h> -pthread_mutex_t tag_pool_lock = PTHREAD_MUTEX_INITIALIZER; +GMutex *tag_pool_lock = NULL; #define NUM_SLOTS 4096 @@ -80,6 +80,19 @@ static struct slot *slot_alloc(struct slot *next, return slot; } +void tag_pool_init(void) +{ + g_assert(tag_pool_lock == NULL); + tag_pool_lock = g_mutex_new(); +} + +void tag_pool_deinit(void) +{ + g_assert(tag_pool_lock != NULL); + g_mutex_free(tag_pool_lock); + tag_pool_lock = NULL; +} + struct tag_item *tag_pool_get_item(enum tag_type type, const char *value, int length) { |