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
@@ -42,7 +41,6 @@ struct mem_pool {
4241 Buffer * buff_last ;
4342 Block * block_head ;
4443 pthread_mutex_t mutex ;
45- pthread_cond_t cond ;
4644};
4745
4846
@@ -79,7 +77,6 @@ MemPool *pool_init(size_t block_size, size_t increase_count)
7977 pool -> block_head = NULL ;
8078
8179 check (pthread_mutex_init (& pool -> mutex , NULL ));
82- check (pthread_cond_init (& pool -> cond , NULL ));
8380
8481 return pool ;
8582}
@@ -186,6 +183,5 @@ void pool_destroy(MemPool *pool)
186183 }
187184
188185 pthread_mutex_destroy (& pool -> mutex );
189- pthread_cond_destroy (& pool -> cond );
190186 free (pool );
191187}
You can’t perform that action at this time.
0 commit comments