From d8c29911dfa8d98b9adcc843bbc43fa6f139fe9b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 8 Sep 2005 13:25:33 +0000 Subject: [PATCH] Added test tstlogthread which tests log system in multi threaded mode --- test/Makefile.am | 14 +++++++-- test/tstlogthread.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 test/tstlogthread.c diff --git a/test/Makefile.am b/test/Makefile.am index 686af4a..b64cc22 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,9 +1,9 @@ ## Copyright (C) 1994-2004, Index Data ## All rights reserved. -## $Id: Makefile.am,v 1.7 2005-08-11 14:00:43 adam Exp $ +## $Id: Makefile.am,v 1.8 2005-09-08 13:25:33 adam Exp $ check_PROGRAMS = tsticonv tstnmem tstmatchstr tstwrbuf tstodr tstccl tstlog \ - tstsoap1 tstsoap2 tstodrstack + tstsoap1 tstsoap2 tstodrstack tstlogthread check_SCRIPTS = tstcql.sh tstmarc.sh TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @@ -12,9 +12,15 @@ EXTRA_DIST = tstodr.asn tstodrcodec.c tstodrcodec.h cqlsample \ $(check_SCRIPTS) \ marc1 marc1.xml marc2 marc2.xml marc3 marc3.xml marc4 marc4.xml +if ISTHR +extra=../src/libyazthread.la +endif + YAZCOMP = $(top_srcdir)/util/yaz-asncomp YAZCOMPLINE = $(YAZCOMP) -d z.tcl -i yaz -I../include $(YCFLAGS) +AM_CFLAGS=@CFLAGSTHREADS@ + AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) dist-hook: @@ -26,7 +32,7 @@ dist-hook: tstodrcodec.c tstodrcodec.h: tstodr.asn $(YAZCOMP) cd $(srcdir); $(YAZCOMP) tstodr.asn -LDADD = ../src/libyaz.la +LDADD = $(extra) ../src/libyaz.la $(LIBTHREAD) tsticonv_SOURCES = tsticonv.c @@ -48,3 +54,5 @@ tstsoap1_SOURCES = tstsoap1.c tstsoap2_SOURCES = tstsoap2.c +tstlogthread_SOURCES = tstlogthread.c + diff --git a/test/tstlogthread.c b/test/tstlogthread.c new file mode 100644 index 0000000..501795f --- /dev/null +++ b/test/tstlogthread.c @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: tstlogthread.c,v 1.1 2005-09-08 13:25:33 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#if HAVE_POSIX_THREADS +#include + + +static void *t_loop2(void *vp) +{ + int i, sz = 10; + + for (i = 0; i