 +	}
  	cond->len = 0;
  	LeaveCriticalSection (&cond->win32_crit);
- #endif /* !_WIN32 */
-@@ -317,6 +322,7 @@
- #	if defined(CONFIG_HAVE_WIN_COND)
+ #endif /* ( _WIN32 < 0x600 ) */
+@@ -324,6 +329,7 @@
  	SleepConditionVariableCS (&cond->win32_cond, spinlock, INFINITE);
  #	else
+ /* Condition variable implementation for Windows XP */
 +	{
  	DWORD status;
  	HANDLE event = TlsGetValue (cond_event_tls);
  
-@@ -340,7 +346,9 @@
+@@ -347,7 +353,9 @@
  
  	if (WAIT_TIMEOUT == status) {
  		EnterCriticalSection (&cond->win32_crit);

 			if (cond->phandle[ i ] == event) {
 				if (i != cond->len - 1)
 					memmove (&cond->phandle[ i ], &cond->phandle[ i + 1 ], sizeof(HANDLE) * (cond->len - i - 1));
@@ -348,9 +356,11 @@
 				break;
 			}
 		}

+	}
 #elif !defined( _WIN32 )
 	posix_check_cmd (pthread_mutex_init (&mutex->pthread_mutex, NULL));
 #elif ( _WIN32_WINNT >= 0x0600 )
@@ -286,8 +288,11 @@
 #else
 /* Condition variable implementation for Windows XP */
 	EnterCriticalSection (&cond->win32_crit);
-	for (unsigned i = 0; i < cond->len; i++)
+	{
