projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into sru_2_0
[yaz-moved-to-github.git]
/
test
/
test_mutex.c
diff --git
a/test/test_mutex.c
b/test/test_mutex.c
index
a4483fc
..
0a7798f
100644
(file)
--- a/
test/test_mutex.c
+++ b/
test/test_mutex.c
@@
-1,7
+1,10
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
@@
-58,9
+61,9
@@
static void tst_cond(void)
{
r = yaz_gettimeofday(&abstime);
YAZ_CHECK_EQ(r, 0);
{
r = yaz_gettimeofday(&abstime);
YAZ_CHECK_EQ(r, 0);
-
+
abstime.tv_sec += 1; /* wait 1 second */
abstime.tv_sec += 1; /* wait 1 second */
-
+
r = yaz_cond_wait(c, p, &abstime);
YAZ_CHECK(r != 0);
r = yaz_cond_wait(c, p, &abstime);
YAZ_CHECK(r != 0);
@@
-88,7
+91,7
@@
static void tst_create_thread(void)
YAZ_CHECK(t[0]);
t[1] = yaz_thread_create(my_handler, &mydata);
YAZ_CHECK(t[1]);
YAZ_CHECK(t[0]);
t[1] = yaz_thread_create(my_handler, &mydata);
YAZ_CHECK(t[1]);
-
+
return_data = 0;
yaz_thread_join(&t[0], &return_data);
YAZ_CHECK(!t[0]);
return_data = 0;
yaz_thread_join(&t[0], &return_data);
YAZ_CHECK(!t[0]);
@@
-98,7
+101,7
@@
static void tst_create_thread(void)
yaz_thread_join(&t[1], &return_data);
YAZ_CHECK(!t[1]);
YAZ_CHECK(return_data == &mydata);
yaz_thread_join(&t[1], &return_data);
YAZ_CHECK(!t[1]);
YAZ_CHECK(return_data == &mydata);
-
+
YAZ_CHECK_EQ(mydata, 44);
}
YAZ_CHECK_EQ(mydata, 44);
}