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:32:21 +0000 (15:32 -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>
23 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_qsbr.c
tests/test_urcu_qsbr_gc.c
tests/test_urcu_qsbr_timing.c
tests/test_urcu_timing.c
tests/test_urcu_wfq.c
tests/test_urcu_wfs.c
urcu/static/urcu-bp.h
urcu/static/urcu-qsbr.h

index ba184a47e241ee2fd0cedb6eca326d805bcd3fac..99e255364fe02d256372b96bbd0fcdffe0a7bb8f 100644 (file)
@@ -195,7 +195,8 @@ void *thr_reader(void *data)
        unsigned long tidx = (unsigned long)data;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -216,7 +217,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",
 
        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);
 
 }
        return ((void*)1);
 
 }
@@ -226,7 +228,8 @@ void *thr_writer(void *data)
        unsigned long wtidx = (unsigned long)data;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -250,7 +253,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -356,7 +360,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",
        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);
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index e8e616637d1b06a3783d2f75fe1d9df73d8b17fb..86a34e2cecd6eb65157c235705936fd7ac6074e9 100644 (file)
@@ -199,7 +199,8 @@ void *thr_reader(void *data)
        unsigned long tidx = (unsigned long)data;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -220,7 +221,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",
 
        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);
 
 }
        return ((void*)1);
 
 }
@@ -231,7 +233,8 @@ void *thr_writer(void *data)
        long tidx;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -259,7 +262,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -364,7 +368,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",
        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);
 
        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",
        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();
        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",
 
        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);
 
 }
        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",
        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++) {
        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",
        }
 
        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);
 }
 
        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",
        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);
 
 
        per_thread_lock = malloc(sizeof(struct per_thread_lock) * NR_READ);
 
index ccbc9d170c9e226dab54944881095f8c1599b39d..a6f8658d6d67e190f51ee4d8e656920329a59dcd 100644 (file)
@@ -191,7 +191,8 @@ void *thr_reader(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -212,7 +213,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -222,7 +224,8 @@ void *thr_writer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -246,7 +249,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -352,7 +356,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",
        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);
 
        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",
        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();
        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",
 
        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);
 
 }
        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",
        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++) {
        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",
        }
 
        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);
 }
 
        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",
        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,
 
        for (i = 0; i < NR_READ; i++) {
                err = pthread_create(&tid_reader[i], NULL, thr_reader,
index 1b1b94b5bfcebc77c3fec5481e528858d62ed4f9..f904ddd902ac1bcdb328ec2d852d2a22cc9aad14 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",
        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();
 
 
        set_affinity();
 
@@ -256,7 +257,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -267,7 +269,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -296,7 +299,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -401,7 +405,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",
        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);
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 31e22e511b96d5a61a45699a45225f35f3b6301a..b510ec811ba855a5d4a8678dbe75144254f7e2a9 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",
        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();
 
 
        set_affinity();
 
@@ -252,7 +253,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -263,7 +265,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -293,7 +296,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        *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",
        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);
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 41caeb0995d1d19cfc6bab50d2179c5e2399d576..26ed741f6cca53fb04a5bb05400e891366fa169c 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",
        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();
 
 
        set_affinity();
 
@@ -252,7 +253,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -263,7 +265,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -292,7 +295,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -397,7 +401,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",
        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);
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index cd9780b6f02f0b44d6f08e5ce5961590ebcde04a..d995b3743b1f0fb1b0f1c60dc8f34b67d64ac930 100644 (file)
@@ -194,7 +194,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -223,7 +224,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -243,7 +245,8 @@ void *thr_writer(void *data)
        int ret;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -282,7 +285,8 @@ void *thr_writer(void *data)
        rcu_defer_unregister_thread();
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        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);
 }
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -387,7 +391,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",
        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);
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index 3a425068e8db00f8ab27651fe48d185c15930125..d2de751a028b7fee36bdff9f7f1d5951a2ea697a 100644 (file)
@@ -202,7 +202,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        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",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -277,7 +279,8 @@ void *thr_writer(void *data)
 #endif
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
 #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();
 
 
        set_affinity();
 
@@ -303,7 +306,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -415,7 +419,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",
        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);
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index 5710de08135f8e0f58be45bfec59cca94636031e..a2b5b7bca656902dc11b3d3e3d2902a8235df0c0 100644 (file)
@@ -201,7 +201,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",
 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();
 
 
        rcu_register_thread();
 
@@ -536,7 +537,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",
        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);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
 
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
        tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
index a789236ecb0c67f875d1f8c0d17cbb28d429d7d4..c750b4700d4e7785635b85f0d4d2b82fced09cc6 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",
        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();
 
 
        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",
 
        *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));
        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",
        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();
 
 
        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",
        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, "
        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);
                        URCU_TLS(nr_addexist), URCU_TLS(nr_del),
                        URCU_TLS(nr_delnoent));
        count->update_ops = URCU_TLS(nr_writes);
index 610f479080e257e3460651a15281f53e33e4ba07..e911694a5b888a864c492b83fdbc42c9f2e459ec 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",
        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();
 
 
        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",
 
        *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));
        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",
        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();
 
 
        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",
        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, "
        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);
                        URCU_TLS(nr_addexist), URCU_TLS(nr_del),
                        URCU_TLS(nr_delnoent));
        count->update_ops = URCU_TLS(nr_writes);
index 66ddd410c6d7d80c26bd35bf95e425fbfaf611ae..a2b1ef62a4373dca181b5e5bd5212cd640c6562d 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",
        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();
 
 
        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",
        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);
 
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -225,7 +227,8 @@ void *thr_dequeuer(void *_count)
        int ret;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        int ret;
 
        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();
 
 
        set_affinity();
 
@@ -266,7 +269,8 @@ void *thr_dequeuer(void *_count)
        rcu_defer_unregister_thread();
        printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
                       "dequeues %llu, successful_dequeues %llu\n",
        rcu_defer_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);
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -374,7 +378,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",
        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);
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index 88bf65d09bd533bf19139a4028e68e990e43ea64..262add94794494af72393ebc853687a72c703950 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",
        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();
 
 
        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",
        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);
 
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -224,7 +226,8 @@ void *thr_dequeuer(void *_count)
        int ret;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        int ret;
 
        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();
 
 
        set_affinity();
 
@@ -264,7 +267,8 @@ void *thr_dequeuer(void *_count)
 
        printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
                       "dequeues %llu, successful_dequeues %llu\n",
 
        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);
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -372,7 +376,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",
        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);
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index 421fb0739bd8f665d22f25bf9f04a607776ecbf2..112e3a239699d155988c1ec8aa792d32afa0628d 100644 (file)
@@ -222,7 +222,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -258,7 +259,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -269,7 +271,8 @@ void *thr_writer(void *_count)
        struct test_array *new, *old;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -299,7 +302,8 @@ void *thr_writer(void *_count)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        *count = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -404,7 +408,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",
        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);
 
        test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
        tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
index 561a475d30c178c907ec5a9402060b9b8db685a2..0b01f229e3e911782e0d63fa04e1134bea63659f 100644 (file)
@@ -198,7 +198,8 @@ void *thr_reader(void *_count)
        struct test_array *local_ptr;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -230,7 +231,8 @@ void *thr_reader(void *_count)
 
        *count = URCU_TLS(nr_reads);
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
 
        *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);
 
 }
        return ((void*)1);
 
 }
@@ -276,7 +278,8 @@ void *thr_writer(void *data)
 #endif
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
 #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();
 
 
        set_affinity();
 
@@ -302,7 +305,8 @@ void *thr_writer(void *data)
        }
 
        printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
        }
 
        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);
 }
        tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
        return ((void*)2);
 }
@@ -415,7 +419,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",
        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);
 
        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",
        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();
        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",
 
        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);
 
 }
        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",
        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++) {
        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",
        }
 
        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);
 }
 
        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",
        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,
 
        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",
        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();
        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",
 
        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);
 
 }
        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",
        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++) {
        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",
        }
 
        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);
 }
 
        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",
        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,
 
        for (i = 0; i < NR_READ; i++) {
                err = pthread_create(&tid_reader[i], NULL, thr_reader,
index 75a9275e74f2d9a4ae42c2fd1e9fa4ce33751546..985f0d18edda6e988f93e7b70c3c05bb6a240ac2 100644 (file)
@@ -164,7 +164,8 @@ void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -193,7 +194,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",
        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);
 
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -204,7 +206,8 @@ void *thr_dequeuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -230,7 +233,8 @@ void *thr_dequeuer(void *_count)
 
        printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
                       "dequeues %llu, successful_dequeues %llu\n",
 
        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);
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -335,7 +339,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",
        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);
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index be099449a78c6845f2af1eaefc6bc18d0c8ff6df..d2c470526a8151d708dc88c6c0744251212b8d4c 100644 (file)
@@ -164,7 +164,8 @@ void *thr_enqueuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -193,7 +194,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",
        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);
 
                       URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
        return ((void*)1);
 
@@ -204,7 +206,8 @@ void *thr_dequeuer(void *_count)
        unsigned long long *count = _count;
 
        printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
        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();
 
 
        set_affinity();
 
@@ -230,7 +233,8 @@ void *thr_dequeuer(void *_count)
 
        printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
                       "dequeues %llu, successful_dequeues %llu\n",
 
        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);
                       URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
        count[0] = URCU_TLS(nr_dequeues);
        count[1] = URCU_TLS(nr_successful_dequeues);
@@ -335,7 +339,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",
        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);
 
        tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
        tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
index a2f73687d0a1995e5b3207b9f3fd3b970499d961..d2843b13ca3eb09962a2b20ae6b959b79adca7af 100644 (file)
@@ -93,7 +93,7 @@ static inline void debug_yield_write(void)
 
 static inline void debug_yield_init(void)
 {
 
 static inline void debug_yield_init(void)
 {
-       URCU_TLS(rand_yield) = time(NULL) ^ pthread_self();
+       URCU_TLS(rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
 }
 #else
 static inline void debug_yield_read(void)
 }
 #else
 static inline void debug_yield_read(void)
index 5580092f4159123f3d948e85b5384b0e58c7a27c..e8cdfbe34d9d26b537fa07d9bae26483f7cc7d68 100644 (file)
@@ -93,7 +93,7 @@ static inline void debug_yield_write(void)
 
 static inline void debug_yield_init(void)
 {
 
 static inline void debug_yield_init(void)
 {
-       URCU_TLS(rand_yield) = time(NULL) ^ pthread_self();
+       URCU_TLS(rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
 }
 #else
 static inline void debug_yield_read(void)
 }
 #else
 static inline void debug_yield_read(void)
This page took 0.043779 seconds and 4 git commands to generate.