X-Git-Url: http://git.liburcu.org/?p=userspace-rcu.git;a=blobdiff_plain;f=tests%2Ftest_urcu_lfs.c;h=5c350eb470adf8c7e2348dc05c2fe765628ca4c8;hp=6bcf1be7e012ed1cf7cbf4d997bd1e9d78566bc6;hb=f90535ef41a3ddef0c8bcd76a6ecb89f3fd09fc3;hpb=95d8822d8b4c4a3563bf51c7c718350eb2babd20 diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c index 6bcf1be..5c350eb 100644 --- a/tests/test_urcu_lfs.c +++ b/tests/test_urcu_lfs.c @@ -199,7 +199,7 @@ fail: count[1] = URCU_TLS(nr_successful_enqueues); printf_verbose("enqueuer thread_end, thread id : %lx, tid %lu, " "enqueues %llu successful_enqueues %llu\n", - pthread_self(), + (unsigned long) pthread_self(), (unsigned long) gettid(), URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues)); return ((void*)1); @@ -261,7 +261,7 @@ void *thr_dequeuer(void *_count) printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n", - pthread_self(), + (unsigned long) pthread_self(), (unsigned long) gettid(), URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues)); count[0] = URCU_TLS(nr_dequeues); @@ -373,11 +373,12 @@ int main(int argc, char **argv) "main", (unsigned long) pthread_self(), (unsigned long) gettid()); - tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers); - tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers); - count_enqueuer = malloc(2 * sizeof(*count_enqueuer) * nr_enqueuers); - count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers); + tid_enqueuer = calloc(nr_enqueuers, sizeof(*tid_enqueuer)); + tid_dequeuer = calloc(nr_dequeuers, sizeof(*tid_dequeuer)); + count_enqueuer = calloc(nr_enqueuers, 2 * sizeof(*count_enqueuer)); + count_dequeuer = calloc(nr_dequeuers, 2 * sizeof(*count_dequeuer)); cds_lfs_init_rcu(&s); + err = create_all_cpu_call_rcu_data(0); if (err) { printf("Per-CPU call_rcu() worker threads unavailable. Using default global worker thread.\n");