--- a/threadutil/src/ThreadPool.c	2012-04-03 09:01:15.000000000 -0400
+++ b/threadutil/src/ThreadPool.c	2015-05-07 14:37:13.168494069 -0400
@@ -264,7 +264,7 @@
	setpriority(PRIO_PROCESS, 0, 0);
	retVal = 0;
 #elif defined(WIN32)
-	retVal = sched_setscheduler(0, in);
+	retVal = 0;
 #elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
	struct sched_param current;
	int sched_result;
@@ -416,7 +416,7 @@

	gettimeofday(&t, NULL);
 #if defined(WIN32)
-	srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id().p);
+	srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
 #elif defined(BSD) || defined(__OSX__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
	srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
 #elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__)
@@ -654,7 +654,7 @@
		rc = ithread_detach(temp);
		/* ithread_detach will return EINVAL if thread has been
		 successfully detached by ithread_create */
-		if (rc == EINVAL)
+		if (rc == EINVAL || rc == ESRCH)
			rc = 0;
		tp->pendingWorkerThreadStart = 1;
		/* wait until the new worker thread starts */
