Switch thread pool test to threading.h

This commit is contained in:
Nick Terrell
2016-12-31 19:10:13 -05:00
parent 3b9d434356
commit d132433534
3 changed files with 9 additions and 7 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
#include "pool.h"
#include <pthread.h>
#include "threading.h"
#include <stddef.h>
#include <stdio.h>
@@ -31,7 +31,7 @@ int testOrder(size_t numThreads, size_t queueLog) {
POOL_ctx *ctx = POOL_create(numThreads, queueLog);
ASSERT_TRUE(ctx);
data.i = 0;
ASSERT_FALSE(pthread_mutex_init(&data.mutex, NULL));
pthread_mutex_init(&data.mutex, NULL);
{
size_t i;
for (i = 0; i < 1024; ++i) {
@@ -46,7 +46,7 @@ int testOrder(size_t numThreads, size_t queueLog) {
ASSERT_EQ(i, data.data[i]);
}
}
ASSERT_FALSE(pthread_mutex_destroy(&data.mutex));
pthread_mutex_destroy(&data.mutex);
return 0;
}