about summary refs log tree commit diff
path: root/linuxthreads/Examples/ex11.c
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/Examples/ex11.c')
-rw-r--r--linuxthreads/Examples/ex11.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linuxthreads/Examples/ex11.c b/linuxthreads/Examples/ex11.c
index fb09d64561..a01d18db36 100644
--- a/linuxthreads/Examples/ex11.c
+++ b/linuxthreads/Examples/ex11.c
@@ -128,7 +128,8 @@ main (void)
 
   for (n = 0; n < NWRITERS; ++n)
     {
-      int err = pthread_create (&thwr[n], NULL, writer_thread, (void *) n);
+      int err = pthread_create (&thwr[n], NULL, writer_thread,
+				(void *) (long int) n);
 
       if (err != 0)
 	error (EXIT_FAILURE, err, "cannot create writer thread");
@@ -136,7 +137,8 @@ main (void)
 
   for (n = 0; n < NREADERS; ++n)
     {
-      int err = pthread_create (&thrd[n], NULL, reader_thread, (void *) n);
+      int err = pthread_create (&thrd[n], NULL, reader_thread,
+				(void *) (long int) n);
 
       if (err != 0)
 	error (EXIT_FAILURE, err, "cannot create reader thread");