Skip to content

Commit 6745868

Browse files
committed
cond
1 parent c5a6758 commit 6745868

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
compile-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

44
test:
55
make compile-test

src/mem_pool.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
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
}

0 commit comments

Comments
 (0)