mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 11:56:16 +01:00
tests: Fix a scan-build warning about uninitialised threads
It seems that scan-build assumes `n_threads > 0`, but doesn’t assume a tighter condition than that, and hence assumes that the two loops to initialise and join the threads have different numbers of iterations. That’s obviously not the case. Try and help scan-build out here by marking `n_threads` as `const`. I don’t know if this will work, but it’s correct regardless. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
504727c317
commit
6c0bde8aa4
@ -186,7 +186,7 @@ addition_thread (gpointer value)
|
||||
static void
|
||||
test_mutex_perf (gconstpointer data)
|
||||
{
|
||||
guint n_threads = GPOINTER_TO_UINT (data);
|
||||
const guint n_threads = GPOINTER_TO_UINT (data);
|
||||
GThread *threads[THREADS];
|
||||
gint64 start_time;
|
||||
gdouble rate;
|
||||
|
Loading…
Reference in New Issue
Block a user