mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
Merge branch 'onceinit-joins' into 'main'
tests: Add some missing g_thread_join() calls to onceinit test See merge request GNOME/glib!3295
This commit is contained in:
commit
49467e3453
@ -266,16 +266,22 @@ test_onceinit (void)
|
||||
g_cond_broadcast (&tcond);
|
||||
}
|
||||
|
||||
for (i = 0; i < N_THREADS; i++)
|
||||
g_thread_join (threads[i]);
|
||||
|
||||
/* call multiple (unoptimized) initializers from multiple threads */
|
||||
g_mutex_lock (&tmutex);
|
||||
g_atomic_int_set (&thread_call_count, 0);
|
||||
|
||||
for (i = 0; i < N_THREADS; i++)
|
||||
g_thread_new (NULL, stress_concurrent_initializers, NULL);
|
||||
threads[i] = g_thread_new (NULL, stress_concurrent_initializers, NULL);
|
||||
g_mutex_unlock (&tmutex);
|
||||
|
||||
while (g_atomic_int_get (&thread_call_count) < 256 * 4 * N_THREADS)
|
||||
g_usleep (50 * 1000); /* wait for all 5 threads to complete */
|
||||
|
||||
for (i = 0; i < N_THREADS; i++)
|
||||
g_thread_join (threads[i]);
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user