From 26d9661aebf68b656af71e5cee27a7a69943706b Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 18 Jan 2010 14:25:51 +0000 Subject: Use new PHTREAD flags --- server/src/mutex.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/src/mutex.cc') 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 #include @@ -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); -- cgit v1.2.3