aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2010-04-12 22:49:58 +0200
committerNick Mathewson <nickm@torproject.org>2010-04-12 18:15:17 -0400
commita02923122e597e833a987dc38a3b0b8a62e0b122 (patch)
tree9374d7de37521150834f7ee08cbde433d57a249c /src
parent0324d3b0ec6d8ee0ec24c2e93915c9aa70e1665d (diff)
downloadtor-a02923122e597e833a987dc38a3b0b8a62e0b122.tar
tor-a02923122e597e833a987dc38a3b0b8a62e0b122.tar.gz
testsuite: Only free the main mutex when and if all the worker threads are done
Diffstat (limited to 'src')
-rw-r--r--src/or/test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 6b7066c38..652a4ee44 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -2356,13 +2356,14 @@ test_util_threads(void)
}
tor_mutex_release(_thread_test_mutex);
}
- 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"));