mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-14 05:42:57 +08:00
12 lines
376 B
C++
12 lines
376 B
C++
QState Table::initial(Table * const me, QEvt const *) {
|
|
uint8_t n;
|
|
me->subscribe(HUNGRY_SIG); // subscribe to HUNGRY
|
|
me->subscribe(DONE_SIG); // subscribe to DONE
|
|
me->subscribe(TERMINATE_SIG); // subscribe to TERMINATE
|
|
for (n = 0; n < N; ++n) {
|
|
me->fork_[n] = FREE;
|
|
me->isHungry_[n] = 0;
|
|
}
|
|
return Q_TRAN(&Table::serving);
|
|
}
|