int
shared_random ()
{
- static unsigned int seed;
int result;
pthread_mutex_lock (&random_mutex);
- result = rand_r (&seed);
+ result = rand ();
pthread_mutex_unlock (&random_mutex);
return result;
}
pthread_mutex_unlock (&fork_mutex[(n + 1) % num_philosophers]);
random_delay ();
}
+
+ return (void *) 0;
}
int