glib/tests/[rec-]mutex: Allow each thread to work

In non-perf mode, we were making only one thread to win the race to increase
the value, but since we're launching more threads anyways let's allow
more of them to have a chance to do something, to make the test more
valuable, even if it's still quick enough.
This commit is contained in:
Marco Trevisan (Treviño) 2023-04-20 17:01:05 +02:00
parent aa72638301
commit 3aeef671d0
2 changed files with 2 additions and 2 deletions

View File

@ -195,7 +195,7 @@ test_mutex_perf (gconstpointer data)
gint x = -1;
guint i;
count_to = g_test_perf () ? 100000000 : 1;
count_to = g_test_perf () ? 100000000 : n_threads + 1;
g_assert (n_threads <= G_N_ELEMENTS (threads));

View File

@ -204,7 +204,7 @@ test_mutex_perf (gconstpointer data)
n_threads = c / 256;
depth = c % 256;
count_to = g_test_perf () ? 100000000 : 1;
count_to = g_test_perf () ? 100000000 : n_threads + 1;
for (i = 0; i < n_threads - 1; i++)
threads[i] = g_thread_new ("test", addition_thread, &x);