aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
authorThomas Jansen <mithi@mithi.net>2008-12-28 22:09:42 +0100
committerThomas Jansen <mithi@mithi.net>2008-12-28 22:09:42 +0100
commit28128dc4e3c0cd581e868404034aba120c8b56c1 (patch)
tree3569ab9438b8de85455197fa28d00df067f9b7e3 /src/tag.c
parentce5c22f4f4b463c11c58de2990b8565c061cf58b (diff)
downloadmpd-28128dc4e3c0cd581e868404034aba120c8b56c1.tar.gz
mpd-28128dc4e3c0cd581e868404034aba120c8b56c1.tar.xz
mpd-28128dc4e3c0cd581e868404034aba120c8b56c1.zip
tag & tag_pool: migrate from pthread to glib threads
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tag.c b/src/tag.c
index 5e2a3620e..3f7720d88 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -247,9 +247,9 @@ static void deleteItem(struct tag *tag, int idx)
assert(idx < tag->numOfItems);
tag->numOfItems--;
- pthread_mutex_lock(&tag_pool_lock);
+ g_mutex_lock(tag_pool_lock);
tag_pool_put_item(tag->items[idx]);
- pthread_mutex_unlock(&tag_pool_lock);
+ g_mutex_unlock(tag_pool_lock);
if (tag->numOfItems - idx > 0) {
memmove(tag->items + idx, tag->items + idx + 1,
@@ -281,10 +281,10 @@ void tag_free(struct tag *tag)
{
int i;
- pthread_mutex_lock(&tag_pool_lock);
+ g_mutex_lock(tag_pool_lock);
for (i = tag->numOfItems; --i >= 0; )
tag_pool_put_item(tag->items[i]);
- pthread_mutex_unlock(&tag_pool_lock);
+ g_mutex_unlock(tag_pool_lock);
if (tag->items == bulk.items) {
#ifndef NDEBUG
@@ -311,10 +311,10 @@ struct tag *tag_dup(const struct tag *tag)
ret->numOfItems = tag->numOfItems;
ret->items = ret->numOfItems > 0 ? g_malloc(items_size(tag)) : NULL;
- pthread_mutex_lock(&tag_pool_lock);
+ g_mutex_lock(tag_pool_lock);
for (i = 0; i < tag->numOfItems; i++)
ret->items[i] = tag_pool_dup_item(tag->items[i]);
- pthread_mutex_unlock(&tag_pool_lock);
+ g_mutex_unlock(tag_pool_lock);
return ret;
}
@@ -444,9 +444,9 @@ static void appendToTagItems(struct tag *tag, enum tag_type type,
items_size(tag) - sizeof(struct tag_item *));
}
- pthread_mutex_lock(&tag_pool_lock);
+ g_mutex_lock(tag_pool_lock);
tag->items[i] = tag_pool_get_item(type, p, len);
- pthread_mutex_unlock(&tag_pool_lock);
+ g_mutex_unlock(tag_pool_lock);
g_free(duplicated);
}