|
@@ -448,6 +448,11 @@ test_util_threads(void)
|
|
|
char *s1 = NULL, *s2 = NULL;
|
|
|
int done = 0, timedout = 0;
|
|
|
time_t started;
|
|
|
+#ifndef MS_WINDOWS
|
|
|
+ struct timeval tv;
|
|
|
+ tv.tv_sec=0;
|
|
|
+ tv.tv_usec=10;
|
|
|
+#endif
|
|
|
#ifndef TOR_IS_MULTITHREADED
|
|
|
|
|
|
* everywhere by now. */
|
|
@@ -477,14 +482,18 @@ test_util_threads(void)
|
|
|
timedout = done = 1;
|
|
|
}
|
|
|
tor_mutex_release(_thread_test_mutex);
|
|
|
+#ifndef MS_WINDOWS
|
|
|
+
|
|
|
+ select(0, NULL, NULL, NULL, &tv);
|
|
|
+#endif
|
|
|
}
|
|
|
- tor_mutex_free(_thread_test_mutex);
|
|
|
-
|
|
|
tor_mutex_acquire(_thread_test_start1);
|
|
|
tor_mutex_release(_thread_test_start1);
|
|
|
tor_mutex_acquire(_thread_test_start2);
|
|
|
tor_mutex_release(_thread_test_start2);
|
|
|
|
|
|
+ tor_mutex_free(_thread_test_mutex);
|
|
|
+
|
|
|
if (timedout) {
|
|
|
printf("\nTimed out: %d %d", t1_count, t2_count);
|
|
|
test_assert(strmap_get(_thread_test_strmap, "thread 1"));
|