/*===========================================================================* * printer_task * *===========================================================================*/ PUBLIC void printer_task() { message m; /* buffer for all incoming messages */ while (TRUE) { receive(ANY, &m); switch(m.m_type) { case TTY_WRITE: do_write(&m); break; case CANCEL : do_cancel(&m); break; case HARD_INT : do_done(&m); break; default: break; } } }
/* Kernel thread */ static int uh_thread(void *data) { struct uh_data *uh = (struct uh_data *)data; while (!kthread_should_stop()) { do_wait(uh); if (kthread_should_stop()) break; do_detect(uh); do_notify(uh); do_done(uh); } D("Exit.\n"); return 0; }
/// Tells if workload generation is done public: bool done() const { return do_done(); }