qpc/doxygen/snippets/qf_subscribe.c
Quantum Leaps f165ec4842 5.6.0-beta
2015-12-24 14:33:20 -05:00

14 lines
470 B
C

QState Table_initial(Table * const me, QEvt const * const e) {
uint8_t n;
(void)e; /* suppress the compiler warning */
QActive_subscribe(&me->super, HUNGRY_SIG); /* subscribe to HUNGRY */
QActive_subscribe(&me->super, DONE_SIG); /*... to DONE */
QActive_subscribe(&me->super, TERMINATE_SIG); /*...and to TERMINATE */
for (n = 0; n < N; ++n) {
me->fork[n] = FREE;
me->isHungry[n] = 0;
}
return Q_TRAN(&Table_serving);
}