Exemple #1
0
/* Starts up the calendar thread.
 */
void *startup_timer_thread(void *arg)
{
	time_t justone = 0, trottime = 0;
	statistics_t trotstat;
	mythread_t *mt;

	thread_init();

	mt = thread_get_mythread();

	while (thread_alive (mt)) {
		time_t stime = get_time();

		timer_handle_status_lines (stime);

		timer_handle_transfer_statistics (stime, &trottime, &justone, &trotstat);

		if (mt->ping == 1)
			mt->ping = 0;

		my_sleep(400000);
	}
	
	thread_exit(7);
	return NULL;
}
Exemple #2
0
void
exit(int status)
{
  printf ("%s: exit(%d)\n", thread_current()->name, status);
  struct thread *t = thread_current ();
  if (thread_alive(t->parent))
  {
    t->cp->exit = true;
    t->cp->status = status;
  }
  thread_exit();
}