summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/test_rwlock.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-01 10:54:06 -0700
committerFlorin Coras <florin.coras@gmail.com>2019-08-01 19:16:37 +0000
commit4f9446444d0c718886570626d6e7a25d07610f1b (patch)
treec1d482ea1d3b46acd64ea5d06fa88df46e6407f4 /src/vppinfra/test_rwlock.c
parent3b9374fa57218c72306d372167724e88ef7d57be (diff)
vppinfra: fix spinlock and rwlock tests
Type: fix Change-Id: I67b72b5ad03b972198c27bc0d927867f41b0e20b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vppinfra/test_rwlock.c')
-rw-r--r--src/vppinfra/test_rwlock.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vppinfra/test_rwlock.c b/src/vppinfra/test_rwlock.c
index 8b6f927d63e..ad1c7bc4f33 100644
--- a/src/vppinfra/test_rwlock.c
+++ b/src/vppinfra/test_rwlock.c
@@ -110,12 +110,12 @@ test_rwlock (rwlock_test_main_t * rtm, f64 * elapse_time)
for (uword t_num = 0; t_num < rtm->threads_per_core; t_num++)
{
uword t_index = cores_set * rtm->threads_per_core + t_num;
- if (error = pthread_create (&pthread[t_index], NULL,
- &read_shared_counter, rtm))
+ if ((error = pthread_create (&pthread[t_index], NULL,
+ &read_shared_counter, rtm)))
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_set_affinity_np failed with %d",
error);
}
@@ -138,12 +138,12 @@ test_rwlock (rwlock_test_main_t * rtm, f64 * elapse_time)
for (uword t_num = 0; t_num < rtm->threads_per_core; t_num++)
{
uword t_index = cores_set * rtm->threads_per_core + t_num;
- if (error = pthread_create (&pthread[t_index], NULL,
- &write_shared_counter, rtm))
+ if ((error = pthread_create (&pthread[t_index], NULL,
+ &write_shared_counter, rtm)))
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_set_affinity_np failed with %d",
error);
}
@@ -157,7 +157,7 @@ test_rwlock (rwlock_test_main_t * rtm, f64 * elapse_time)
for (uword thread_num = 0; thread_num < total_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);