From 6745868dda6ffb32778f0dddcae23aecaa8dc44d Mon Sep 17 00:00:00 2001 From: Isty001 Date: Mon, 13 Feb 2017 19:21:29 +0100 Subject: [PATCH] cond --- Makefile | 2 +- src/mem_pool.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a830868..0e80ba9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ compile-test: - gcc -g -Wall -Wextra src/*.c test/*.c -o test.o + gcc -g -Wall -Wextra src/*.c test/*.c -lpthread -o test.o test: make compile-test diff --git a/src/mem_pool.c b/src/mem_pool.c index 4b92ec1..3a05a3f 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -15,7 +15,6 @@ check(pthread_mutex_lock(&pool->mutex)); #define unlock(pool) \ - check(pthread_cond_broadcast(&pool->cond)); \ check(pthread_mutex_unlock(&pool->mutex)); @@ -41,7 +40,6 @@ struct mem_pool { Buffer *buff_last; Block *block_head; pthread_mutex_t mutex; - pthread_cond_t cond; }; @@ -77,7 +75,6 @@ MemPool *pool_init(size_t block_size, size_t increase_count) pool->block_head = NULL; check(pthread_mutex_init(&pool->mutex, NULL)); - check(pthread_cond_init(&pool->cond, NULL)); return pool; } @@ -169,6 +166,5 @@ void pool_destroy(MemPool *pool) } pthread_mutex_destroy(&pool->mutex); - pthread_cond_destroy(&pool->cond); free(pool); }