]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
testsuite: Only free the main mutex when and if all the worker threads are done
authorPeter Palfrader <peter@palfrader.org>
Mon, 12 Apr 2010 20:49:58 +0000 (22:49 +0200)
committerNick Mathewson <nickm@torproject.org>
Mon, 12 Apr 2010 22:15:17 +0000 (18:15 -0400)
changes/weasel-testuite-thread-fixes [new file with mode: 0644]
src/or/test.c

diff --git a/changes/weasel-testuite-thread-fixes b/changes/weasel-testuite-thread-fixes
new file mode 100644 (file)
index 0000000..8fed729
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Testsuite:  In the util/threads test no longer free the test_mutex
+      before all worker threads have finished.
index 6b7066c38552a727fc4f75136cda0caa35c35e68..652a4ee44fad2c5b692f9b7ba7e7ee23b792b014 100644 (file)
@@ -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"));