- 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
+ id[i] = write_flag;
+#if YAZ_POSIX_THREADS
+ pthread_create(&child_thread[i], 0 /* attr */, run_func, &id[i]);
+#endif
+#ifdef WIN32
+ if (1)
+ {
+ 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 */
+ }
+
+#endif