Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Isty001 committed Apr 14, 2017
2 parents 5ec16e4 + 6745868 commit 53583d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/mem_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));


Expand All @@ -42,7 +41,6 @@ struct mem_pool {
Buffer *buff_last;
Block *block_head;
pthread_mutex_t mutex;
pthread_cond_t cond;
};


Expand Down Expand Up @@ -79,7 +77,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;
}
Expand Down Expand Up @@ -186,6 +183,5 @@ void pool_destroy(MemPool *pool)
}

pthread_mutex_destroy(&pool->mutex);
pthread_cond_destroy(&pool->cond);
free(pool);
}

0 comments on commit 53583d6

Please sign in to comment.