mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
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:
parent
aa72638301
commit
3aeef671d0
@ -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));
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user