lwp: fix the rw test program
authorChas Williams (CONTRACTOR) <chas@cmf.nrl.navy.mil>
Sat, 19 Feb 2011 13:26:20 +0000 (08:26 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 20 Feb 2011 13:57:05 +0000 (05:57 -0800)
We should not need to prototype calloc() anymore and osi_Assert() has
been replaced with assert() apparently.

Change-Id: I3ef6178c589cabcd0637cd88c35d2276833b4590
Change-Id: I0626475f120ff9a373e0251f3c4485c052922747
Reviewed-on: http://gerrit.openafs.org/3991
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/lwp/rw.c

index 6fff9c7..3710db4 100644 (file)
@@ -23,7 +23,6 @@ Created: 11/1/83, J. Rosenberg
 #include <stdlib.h>
 #else
 #include <sys/time.h>
-extern char *calloc();
 #endif
 #include <stdio.h>
 #include <stdlib.h>
@@ -31,7 +30,6 @@ extern char *calloc();
 #include "lwp.h"
 #include "lock.h"
 #include "preempt.h"
-#include <afs/afs_assert.h>
 
 #define DEFAULT_READERS        5
 
@@ -81,7 +79,7 @@ Remove(queue *q)
 
     if (empty(q)) {
        printf("Remove from empty queue");
-       osi_Assert(0);
+       exit(0);
     }
 
     old = q->next;
@@ -97,9 +95,10 @@ queue *q;
 int asleep;                    /* Number of processes sleeping -- used for
                                 * clean termination */
 
-static int
-read_process(int *id)
+static void *
+read_process(void *arg)
 {
+    int *id = (int *) arg;
     printf("\t[Reader %d]\n", *id);
     LWP_DispatchProcess();     /* Just relinquish control for now */
 
@@ -126,8 +125,8 @@ read_process(int *id)
     return 0;
 }
 
-static int
-write_process()
+static void *
+write_process(void *dummy)
 {
     static char *messages[] = {
        "Mary had a little lamb,",