Cleanup: cast pthread_self() return value to unsigned long
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Nov 2012 20:28:59 +0000 (15:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Nov 2012 20:28:59 +0000 (15:28 -0500)
pthread_t can map to other things that unsigned long (e.g. pointer).
Cast it to unsigned long for debug printing and for debug delay random
value purposes.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
25 files changed:
tests/test_mutex.c
tests/test_perthreadlock.c
tests/test_perthreadlock_timing.c
tests/test_rwlock.c
tests/test_rwlock_timing.c
tests/test_urcu.c
tests/test_urcu_assign.c
tests/test_urcu_bp.c
tests/test_urcu_defer.c
tests/test_urcu_gc.c
tests/test_urcu_hash.c
tests/test_urcu_hash_rw.c
tests/test_urcu_hash_unique.c
tests/test_urcu_lfq.c
tests/test_urcu_lfs.c
tests/test_urcu_lfs_rcu.c
tests/test_urcu_qsbr.c
tests/test_urcu_qsbr_gc.c
tests/test_urcu_qsbr_timing.c
tests/test_urcu_timing.c
tests/test_urcu_wfcq.c
tests/test_urcu_wfq.c
tests/test_urcu_wfs.c
urcu/static/urcu-bp.h
urcu/static/urcu-qsbr.h

index 43d0dace7169d7d8e30ea502400cb2072d1721eb..451ab1c31172ef1922570db4df97e038ba20351c 100644 (file)
@@ -196,7 +196,8 @@ void *thr_reader(void *data)
        unsigned long tidx = (unsigned long)data;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -217,7 +218,8 @@ void *thr_reader(void *data)
 
        tot_nr_reads[tidx] = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -227,7 +229,8 @@ void *thr_writer(void *data)
        unsigned long wtidx = (unsigned long)data;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -251,7 +254,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -357,7 +361,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index 47eaff6918faa324009888738c05900c98b86e04..cfde1b6942a064f260b514b89f1bb6cb510d458f 100644 (file)
@@ -200,7 +200,8 @@ void *thr_reader(void *data)
        unsigned long tidx = (unsigned long)data;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -221,7 +222,8 @@ void *thr_reader(void *data)
 
        tot_nr_reads[tidx] = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -232,7 +234,8 @@ void *thr_writer(void *data)
        long tidx;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -260,7 +263,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -365,7 +369,7 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(), (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index bc20ed0599cf4610fe42146f6456da90fc66f3d3..d0cc11c3841df70e08a1718417cc9e9c134d1116 100644 (file)
@@ -91,7 +91,8 @@ void *thr_reader(void *arg)
        long tidx = (long)arg;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        time1 = caa_get_cycles();
@@ -108,7 +109,8 @@ void *thr_reader(void *arg)
 
        sleep(2);
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -120,7 +122,8 @@ void *thr_writer(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        for (i = 0; i < OUTER_WRITE_LOOP; i++) {
@@ -140,7 +143,8 @@ void *thr_writer(void *arg)
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)2);
 }
 
@@ -166,7 +170,8 @@ int main(int argc, char **argv)
        tid_writer = malloc(sizeof(*tid_writer) * num_write);
 
        printf("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        per_thread_lock = malloc(sizeof(struct per_thread_lock) * NR_READ);
 
index 45dad7869427fc434a021f5bddc60f3f7590ea06..b787364ee8023045220ab2c868b2a8da3682b5e9 100644 (file)
@@ -192,7 +192,8 @@ void *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());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -213,7 +214,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -223,7 +225,8 @@ void *thr_writer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -247,7 +250,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -353,7 +357,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index 628bed459af61e38afada3626e2b05e8dd659ab6..bc7737002596a5856f278b5fcd1898292d069c83 100644 (file)
@@ -87,7 +87,8 @@ void *thr_reader(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        time1 = caa_get_cycles();
@@ -104,7 +105,8 @@ void *thr_reader(void *arg)
 
        sleep(2);
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -115,7 +117,8 @@ void *thr_writer(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        for (i = 0; i < OUTER_WRITE_LOOP; i++) {
@@ -131,7 +134,8 @@ void *thr_writer(void *arg)
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)2);
 }
 
@@ -157,7 +161,8 @@ int main(int argc, char **argv)
        tid_writer = malloc(sizeof(*tid_writer) * num_write);
 
        printf("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        for (i = 0; i < NR_READ; i++) {
                err = pthread_create(&tid_reader[i], NULL, thr_reader,
index 373e1d2df397f0792e55c4be94dbc6e4639e2c80..6463d675f8dc971fc983d52ab6d403721c48d595 100644 (file)
@@ -224,7 +224,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -257,7 +258,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -268,7 +270,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -297,7 +300,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -402,7 +406,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long)gettid());
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 9e10225ad204d02efc3c39a7e7e35c91e95339e3..489a4c23e58d883b381cc5894aae64a18ab690e2 100644 (file)
@@ -224,7 +224,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -253,7 +254,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -264,7 +266,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -294,7 +297,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -399,7 +403,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 8ab0f5ac4cd900dab6867b32aef1ffbafcc93c35..7902388e43584dc76752d9ac756ef2cff87d34d7 100644 (file)
@@ -224,7 +224,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -253,7 +254,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -264,7 +266,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -293,7 +296,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -398,7 +402,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 8d030df807ad2abeffeb5580e715b020d39aeea0..c79943761db4afb3f45d0918f68f5d2b71bfcdcc 100644 (file)
@@ -195,7 +195,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -224,7 +225,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -244,7 +246,8 @@ void *thr_writer(void *data)
        int ret;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -283,7 +286,8 @@ void *thr_writer(void *data)
        rcu_defer_unregister_thread();
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -388,7 +392,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index d2c880653fccbcf0c5984b74117a91f10ce5365c..777e04bb3f3d9bbced330d9bc0d6411d0e8978db 100644 (file)
@@ -203,7 +203,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -232,7 +233,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -278,7 +280,8 @@ void *thr_writer(void *data)
 #endif
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -304,7 +307,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -416,7 +420,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index 7a28677faf4a283d7827a51a4af73ce77f6cf977..514d0bcdcf20496805ef3fc97c90f3f51b6acb5a 100644 (file)
@@ -202,7 +202,8 @@ unsigned long test_compare(const void *key1, size_t key1_len,
 void *thr_count(void *arg)
 {
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "counter", pthread_self(), (unsigned long)gettid());
+                       "counter", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        rcu_register_thread();
 
@@ -544,7 +545,8 @@ int main(int argc, char **argv)
        printf_verbose("Number of hash chains: %lu.\n",
                nr_hash_chains);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        if (!tid_reader) {
index 3eb72924cd79a3d0651efbf7832198d9df8d1bb7..f30207d000ca039f0c3394b0fefce3bbb41aecb7 100644 (file)
@@ -66,7 +66,8 @@ void *test_hash_rw_thr_reader(void *_count)
        struct cds_lfht_iter iter;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -107,7 +108,8 @@ void *test_hash_rw_thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
                        pthread_self(), URCU_TLS(lookup_fail),
                        URCU_TLS(lookup_ok));
@@ -124,7 +126,8 @@ void *test_hash_rw_thr_writer(void *_count)
        int ret;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -209,9 +212,10 @@ void *test_hash_rw_thr_writer(void *_count)
        rcu_unregister_thread();
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) 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),
+                       "nr_delnoent %lu\n", (unsigned long) pthread_self(), URCU_TLS(nr_add),
                        URCU_TLS(nr_addexist), URCU_TLS(nr_del),
                        URCU_TLS(nr_delnoent));
        count->update_ops = URCU_TLS(nr_writes);
index 89e294327b1596ae634ccee507831b79d6bc7fcd..b36d782791a9686ae992fc6cfb3fe52fe7c3a3de 100644 (file)
@@ -64,7 +64,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());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -109,7 +110,8 @@ void *test_hash_unique_thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
                        pthread_self(), URCU_TLS(lookup_fail),
                        URCU_TLS(lookup_ok));
@@ -127,7 +129,8 @@ void *test_hash_unique_thr_writer(void *_count)
        int loc_add_unique;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -221,9 +224,10 @@ 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());
+                       "writer", (unsigned long) 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),
+                       "nr_delnoent %lu\n", (unsigned long) pthread_self(), URCU_TLS(nr_add),
                        URCU_TLS(nr_addexist), URCU_TLS(nr_del),
                        URCU_TLS(nr_delnoent));
        count->update_ops = URCU_TLS(nr_writes);
index 6b2bf051da80f5af9887a80797ee57fa8fca28d0..2291f4fa827eb67bf7a605330c8fe6d00733ecd0 100644 (file)
@@ -170,7 +170,8 @@ void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "enqueuer", pthread_self(), (unsigned long)gettid());
+                       "enqueuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -205,7 +206,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -224,7 +226,8 @@ void *thr_dequeuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "dequeuer", pthread_self(), (unsigned long)gettid());
+                       "dequeuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -260,7 +263,8 @@ void *thr_dequeuer(void *_count)
        rcu_unregister_thread();
        printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
                       "dequeues %llu, successful_dequeues %llu\n",
-                      pthread_self(), (unsigned long)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -368,7 +372,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", rduration);
        printf_verbose("Reader duration : %lu loops.\n", wdelay);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index 816447f6c7f2d23aa9af110fbe7f56b652d891aa..28e3e0678cf0b4b163786b97bb024d8a8d42c9ce 100644 (file)
@@ -182,7 +182,8 @@ static void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "enqueuer", pthread_self(), (unsigned long)gettid());
+                       "enqueuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -215,7 +216,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -280,7 +282,8 @@ static void *thr_dequeuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "dequeuer", pthread_self(), (unsigned long)gettid());
+                       "dequeuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -320,7 +323,8 @@ static 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -453,7 +457,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", rduration);
        printf_verbose("Reader duration : %lu loops.\n", wdelay);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index c356d1db0bce24531d1e644bb85a3bdcd2314cd6..b5d1794449a61b0b7f0e31da6c6f62f9c16af2c7 100644 (file)
@@ -173,7 +173,8 @@ void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "enqueuer", pthread_self(), (unsigned long)gettid());
+                       "enqueuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -207,7 +208,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -226,7 +228,8 @@ void *thr_dequeuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "dequeuer", pthread_self(), (unsigned long)gettid());
+                       "dequeuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -261,7 +264,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -369,7 +373,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", rduration);
        printf_verbose("Reader duration : %lu loops.\n", wdelay);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index 2e3e44628ce9a2e9bab460ff3fb318d70df653c8..da26b77329cf11f2a6629643054d4947947dbfa7 100644 (file)
@@ -223,7 +223,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -259,7 +260,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -270,7 +272,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -300,7 +303,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -405,7 +409,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 11668ee017e97f325ea9a9243e02d90aefbe24c7..54797dc9531d70603a614ef1ac870d2daeb9b602 100644 (file)
@@ -199,7 +199,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -231,7 +232,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -277,7 +279,8 @@ void *thr_writer(void *data)
 #endif
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -303,7 +306,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -416,7 +420,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", wdelay);
        printf_verbose("Reader duration : %lu loops.\n", rduration);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index 792554867735702c007736c2713125ffa8060686..b50c95f3f82bdfd3010499291246d084c371c0b0 100644 (file)
@@ -108,7 +108,8 @@ void *thr_reader(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        rcu_register_thread();
@@ -133,7 +134,8 @@ void *thr_reader(void *arg)
 
        sleep(2);
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -145,7 +147,8 @@ void *thr_writer(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        for (i = 0; i < OUTER_WRITE_LOOP; i++) {
@@ -173,7 +176,8 @@ void *thr_writer(void *arg)
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)2);
 }
 
@@ -199,7 +203,8 @@ int main(int argc, char **argv)
        tid_writer = malloc(sizeof(*tid_writer) * num_write);
 
        printf("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        for (i = 0; i < NR_READ; i++) {
                err = pthread_create(&tid_reader[i], NULL, thr_reader,
index 44235ce5c774e4bdf6091c08cac432f38325fade..4de8896b77d024abe2d11b43ba5b9414f1bbbef3 100644 (file)
@@ -107,7 +107,8 @@ void *thr_reader(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        rcu_register_thread();
@@ -131,7 +132,8 @@ void *thr_reader(void *arg)
 
        sleep(2);
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "reader", pthread_self(), (unsigned long)gettid());
+                       "reader", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)1);
 
 }
@@ -143,7 +145,8 @@ void *thr_writer(void *arg)
        cycles_t time1, time2;
 
        printf("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        sleep(2);
 
        for (i = 0; i < OUTER_WRITE_LOOP; i++) {
@@ -171,7 +174,8 @@ void *thr_writer(void *arg)
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
-                       "writer", pthread_self(), (unsigned long)gettid());
+                       "writer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
        return ((void*)2);
 }
 
@@ -197,7 +201,8 @@ int main(int argc, char **argv)
        tid_writer = malloc(sizeof(*tid_writer) * num_write);
 
        printf("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        for (i = 0; i < NR_READ; i++) {
                err = pthread_create(&tid_reader[i], NULL, thr_reader,
index 30d2e919e382e5dfc7ceb47c427c27529eeb9001..f90fc14baf52bc00229d9e9672e3ce4953d86f86 100644 (file)
@@ -175,7 +175,8 @@ static void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "enqueuer", pthread_self(), (unsigned long)gettid());
+                       "enqueuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -204,7 +205,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -254,7 +256,8 @@ static void *thr_dequeuer(void *_count)
        unsigned int counter;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "dequeuer", pthread_self(), (unsigned long)gettid());
+                       "dequeuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -284,7 +287,8 @@ static 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -418,7 +422,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", rduration);
        printf_verbose("Reader duration : %lu loops.\n", wdelay);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index d1760414f30378151a62d8c34656e9f09002d6fc..b4138ea6fc4308fdbf01f1bc1dd4b76cd0e55e7c 100644 (file)
@@ -169,7 +169,8 @@ void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "enqueuer", pthread_self(), (unsigned long)gettid());
+                       "enqueuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -198,7 +199,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -209,7 +211,8 @@ void *thr_dequeuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "dequeuer", pthread_self(), (unsigned long)gettid());
+                       "dequeuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -235,7 +238,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -340,7 +344,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", rduration);
        printf_verbose("Reader duration : %lu loops.\n", wdelay);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index 84e50a00b5751ac8cad89d782f852e7f44207c30..cb85545a3ddad5be878a82013febd6f20bcd5c76 100644 (file)
@@ -177,7 +177,8 @@ static void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "enqueuer", pthread_self(), (unsigned long)gettid());
+                       "enqueuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -206,7 +207,8 @@ 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -253,7 +255,8 @@ static void *thr_dequeuer(void *_count)
        unsigned int counter;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
-                       "dequeuer", pthread_self(), (unsigned long)gettid());
+                       "dequeuer", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        set_affinity();
 
@@ -286,7 +289,8 @@ static 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)gettid(),
+                      pthread_self(),
+                       (unsigned long) gettid(),
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -416,7 +420,8 @@ int main(int argc, char **argv)
        printf_verbose("Writer delay : %lu loops.\n", rduration);
        printf_verbose("Reader duration : %lu loops.\n", wdelay);
        printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
-                       "main", pthread_self(), (unsigned long)gettid());
+                       "main", (unsigned long) pthread_self(),
+                       (unsigned long) gettid());
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index 6187bd31b5325fb292057e95f7236285cb846019..c52a68870dbadfb9c45ca2e688a5e45d39d25f3c 100644 (file)
@@ -93,7 +93,7 @@ static inline void rcu_debug_yield_write(void)
 
 static inline void rcu_debug_yield_init(void)
 {
-       URCU_TLS(rcu_rand_yield) = time(NULL) ^ pthread_self();
+       URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
 }
 #else
 static inline void rcu_debug_yield_read(void)
index 8b16a4abc4586783fd5a267126e43063050f58f6..c8a87b8d777a7ce0bcae127a5d1bd1545bfee561 100644 (file)
@@ -93,7 +93,7 @@ static inline void rcu_debug_yield_write(void)
 
 static inline void rcu_debug_yield_init(void)
 {
-       URCU_TLS(rcu_rand_yield) = time(NULL) ^ pthread_self();
+       URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
 }
 #else
 static inline void rcu_debug_yield_read(void)
This page took 0.044443 seconds and 4 git commands to generate.