From 28128dc4e3c0cd581e868404034aba120c8b56c1 Mon Sep 17 00:00:00 2001 From: Thomas Jansen <mithi@mithi.net> Date: Sun, 28 Dec 2008 22:09:42 +0100 Subject: tag & tag_pool: migrate from pthread to glib threads --- src/tag.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tag.c') 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); } -- cgit v1.2.3