2 * Copyright (c) 1998-2005, Index Data.
3 * See the file LICENSE for details.
5 * $Id: tstlogthread.c,v 1.4 2006-10-09 14:22:44 heikki Exp $
15 #include <yaz/options.h>
21 static void *t_loop2(void *vp)
25 for (i = 0; i<sz; i++)
28 fprintf(stderr, "pr %d\n", i);
30 yaz_log(YLOG_LOG, "pr %d", i);
36 static void t_test(void)
40 pthread_create(tids+0, 0, t_loop2, 0);
41 pthread_create(tids+1, 0, t_loop2, 0);
42 pthread_create(tids+2, 0, t_loop2, 0);
43 pthread_create(tids+3, 0, t_loop2, 0);
45 pthread_join(tids[0], 0);
46 pthread_join(tids[1], 0);
47 pthread_join(tids[2], 0);
48 pthread_join(tids[3], 0);
58 int main(int argc, char **argv)
63 /* t_test is only invoked if a non-option arg is given .. */
64 while ((ret = options("v:l:", argv, argc, &arg)) != -2)
69 yaz_log_init_level (yaz_log_mask_str(arg));
72 yaz_log_init_file(arg);
86 * indent-tabs-mode: nil
88 * vim: shiftwidth=4 tabstop=8 expandtab