tests: use thread-id.h wrapper
[urcu.git] / tests / test_urcu_hash_unique.c
index 610f479080e257e3460651a15281f53e33e4ba07..40d9e80065d83978af2043f04283a28a1d0a5272 100644 (file)
@@ -63,8 +63,8 @@ void *test_hash_unique_thr_reader(void *_count)
 {
        unsigned long long *count = _count;
 
-       printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+       printf_verbose("thread_begin %s, tid %lu\n",
+                       "reader", urcu_get_thread_id());
 
        set_affinity();
 
@@ -95,7 +95,7 @@ void *test_hash_unique_thr_reader(void *_count)
                }
                rcu_read_unlock();
 
-               debug_yield_read();
+               rcu_debug_yield_read();
                if (caa_unlikely(rduration))
                        loop_sleep(rduration);
                URCU_TLS(nr_reads)++;
@@ -108,10 +108,10 @@ void *test_hash_unique_thr_reader(void *_count)
        rcu_unregister_thread();
 
        *count = URCU_TLS(nr_reads);
-       printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
-       printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
-                       pthread_self(), URCU_TLS(lookup_fail),
+       printf_verbose("thread_end %s, tid %lu\n",
+                       "reader", urcu_get_thread_id());
+       printf_verbose("read tid : %lu, lookupfail %lu, lookupok %lu\n",
+                       urcu_get_thread_id(), URCU_TLS(lookup_fail),
                        URCU_TLS(lookup_ok));
        return ((void*)1);
 
@@ -126,8 +126,8 @@ void *test_hash_unique_thr_writer(void *_count)
        int ret;
        int loc_add_unique;
 
-       printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+       printf_verbose("thread_begin %s, tid %lu\n",
+                       "writer", urcu_get_thread_id());
 
        set_affinity();
 
@@ -220,11 +220,13 @@ void *test_hash_unique_thr_writer(void *_count)
 
        rcu_unregister_thread();
 
-       printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
-       printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
-                       "nr_delnoent %lu\n", pthread_self(), URCU_TLS(nr_add),
-                       URCU_TLS(nr_addexist), URCU_TLS(nr_del),
+       printf_verbose("thread_end %s, tid %lu\n",
+                       "writer", urcu_get_thread_id());
+       printf_verbose("info tid %lu: nr_add %lu, nr_addexist %lu, nr_del %lu, "
+                       "nr_delnoent %lu\n", urcu_get_thread_id(),
+                       URCU_TLS(nr_add),
+                       URCU_TLS(nr_addexist),
+                       URCU_TLS(nr_del),
                        URCU_TLS(nr_delnoent));
        count->update_ops = URCU_TLS(nr_writes);
        count->add = URCU_TLS(nr_add);
This page took 0.024109 seconds and 4 git commands to generate.