+static void tst_win32()
+{
+ HANDLE handles[NUM_THREADS];
+ DWORD dwThreadId[NUM_THREADS];
+ int i, id[NUM_THREADS];
+
+ for (i = 0; i<NUM_THREADS; i++)
+ {
+ void *pData = &id[i];
+ handles[i] = CreateThread(
+ NULL, /* default security attributes */
+ 0, /* use default stack size */
+ ThreadProc, /* thread function */
+ pData, /* argument to thread function */
+ 0, /* use default creation flags */
+ &dwThreadId[i]); /* returns the thread identifier */
+ }
+ /* join */
+ WaitForMultipleObjects(NUM_THREADS, handles, TRUE, INFINITE);
+}
+#endif
+
+#if YAZ_POSIX_THREADS
+static void tst_pthread()
+{
+ pthread_t child_thread[NUM_THREADS];
+ int i, id[NUM_THREADS];
+ for (i = 0; i<NUM_THREADS; i++)
+ pthread_create(&child_thread[i], 0 /* attr */, run_func, &id[i]);
+
+ for (i = 0; i<NUM_THREADS; i++)
+ pthread_join(child_thread[i], 0);
+}
+#endif
+