for (uword t_num = 0; t_num < stm->threads_per_core; t_num++)
{
uword t_index = cores_set * stm->threads_per_core + t_num;
- if (error = pthread_create (&pthread[t_index], NULL,
- &inc_shared_counter, stm))
+ if ((error = pthread_create (&pthread[t_index], NULL,
+ &inc_shared_counter, stm)))
clib_unix_warning ("pthread_create failed with %d", error);
- if (error = pthread_setaffinity_np (pthread[t_index],
- sizeof (cpu_set_t), &cpuset))
+ if ((error = pthread_setaffinity_np (pthread[t_index],
+ sizeof (cpu_set_t), &cpuset)))
clib_unix_warning ("pthread_setaffinity_np failed with %d",
error);
}
for (uword thread_num = 0; thread_num < num_threads; thread_num++)
{
f64 *time;
- if (error = pthread_join (pthread[thread_num], (void *) &time))
+ if ((error = pthread_join (pthread[thread_num], (void *) &time)))
clib_unix_warning ("pthread_join failed with %d", error);
*elapse_time += *time;
vec_free (time);