+#ifdef WIN32
+DWORD WINAPI ThreadProc(void *p)
+{
+ run_func(p);
+ return 0;
+}
+
+static void tst1()
+{
+ 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
+ }
+ WaitForMultipleObjects(NUM_THREADS, handles, TRUE, INFINITE);
+ /* join */
+ *seqp++ = '\0';
+}
+#endif
+
+#if YAZ_POSIX_THREADS