gras_init(&argc,argv);
xbt_assert0(argc>=2,"This program expects one argument (the amount of philosophers)");
- INFO0("Wait 1 sec to check that gras_os_sleep do works");
- gras_os_sleep(1);
-
/* initializations of the philosopher mecanisms */
philosopher_amount = atoi(argv[1]);
state = xbt_new0(int,philosopher_amount);
dead_end = xbt_mutex_init();
xbt_mutex_lock(dead_end);
- INFO0("Enough waiting, spawn the threads");
+ INFO2("Spawn the %d threads (%d lunches scheduled)", philosopher_amount, lunch_amount);
/* spawn threads */
for (i=0; i<philosopher_amount; i++) {
char *name = bprintf("thread %d",i);
INFO0("Cancel all childs");
/* nuke them threads */
for (i=0; i<philosopher_amount; i++) {
- INFO1("Canceling %p",philosophers[i]);
- xbt_thread_cancel(philosophers[i]);
+ xbt_thread_cancel(philosophers[i]);
}
xbt_mutex_unlock(dead_end);