X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_mutex.c;h=a4483fcc6fac81954d9278577037799de7f8db2c;hp=6a0b9f140b4413bddfd60edce218f019ad1f5599;hb=df84e4897abc4565fe11adead30b99d9634b41b1;hpb=a4f3aed6537286535d1ea9962adb9ab77c528565 diff --git a/test/test_mutex.c b/test/test_mutex.c index 6a0b9f1..a4483fc 100644 --- a/test/test_mutex.c +++ b/test/test_mutex.c @@ -54,18 +54,17 @@ static void tst_cond(void) return; yaz_cond_create(&c); - YAZ_CHECK(c); - if (!c) - return; - - r = yaz_gettimeofday(&abstime); - YAZ_CHECK_EQ(r, 0); - - abstime.tv_sec += 1; /* wait 1 second */ - - r = yaz_cond_wait(c, p, &abstime); - YAZ_CHECK(r != 0); - + if (c) + { + r = yaz_gettimeofday(&abstime); + YAZ_CHECK_EQ(r, 0); + + abstime.tv_sec += 1; /* wait 1 second */ + + r = yaz_cond_wait(c, p, &abstime); + YAZ_CHECK(r != 0); + + } yaz_cond_destroy(&c); YAZ_CHECK(c == 0); yaz_mutex_destroy(&p);