File tree Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Original file line number Diff line number Diff line change 11compile-test :
2- gcc -g -Wall -Wextra src/* .c test/* .c -o test.o
2+ gcc -g -Wall -Wextra src/* .c test/* .c -lpthread - o test.o
33
44test :
55 make compile-test
Original file line number Diff line number Diff line change 1515 check(pthread_mutex_lock(&pool->mutex));
1616
1717#define unlock (pool ) \
18- check(pthread_cond_broadcast(&pool->cond)); \
1918 check(pthread_mutex_unlock(&pool->mutex));
2019
2120
@@ -41,7 +40,6 @@ struct mem_pool {
4140 Buffer * buff_last ;
4241 Block * block_head ;
4342 pthread_mutex_t mutex ;
44- pthread_cond_t cond ;
4543};
4644
4745
@@ -77,7 +75,6 @@ MemPool *pool_init(size_t block_size, size_t increase_count)
7775 pool -> block_head = NULL ;
7876
7977 check (pthread_mutex_init (& pool -> mutex , NULL ));
80- check (pthread_cond_init (& pool -> cond , NULL ));
8178
8279 return pool ;
8380}
@@ -169,6 +166,5 @@ void pool_destroy(MemPool *pool)
169166 }
170167
171168 pthread_mutex_destroy (& pool -> mutex );
172- pthread_cond_destroy (& pool -> cond );
173169 free (pool );
174170}
You can’t perform that action at this time.
0 commit comments