summaryrefslogtreecommitdiff
path: root/server/src/mutex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/mutex.cc')
-rw-r--r--server/src/mutex.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/mutex.cc b/server/src/mutex.cc
index 23ec255..ec0d0e8 100644
--- a/server/src/mutex.cc
+++ b/server/src/mutex.cc
@@ -66,8 +66,8 @@ MutexAutolock::~MutexAutolock()
#ifdef TEST_MUTEX
//deps:
-//cflags:
-//libs: -lpthread
+//cflags: $(PTHREAD_CFLAGS)
+//libs: $(PTHREAD_LIBS)
#include <test.h>
#include <unistd.h>
@@ -100,12 +100,12 @@ pthread_t tid;
pthread_attr_init(&attr);
pthread_create(&tid, &attr, thread_run, &mutex);
-usleep(100);
-TEST_EQUAL(cnt, 0, "Testing if lock prevent cnt from increasing.");
+sleep(1);
+TEST_EQUAL_INT(cnt, 0, "Testing if lock prevent cnt from increasing.");
mutex.unlock();
-usleep(100);
-TEST_EQUAL(cnt, 1, "Testing if unlock makes cnt increase.");
+sleep(1);
+TEST_EQUAL_INT(cnt, 1, "Testing if unlock makes cnt increase.");
pthread_join(tid, NULL);
pthread_attr_destroy(&attr);