qpcpp/doxygen/snippets/qf_subscribe.cpp

12 lines
325 B
C++
Raw Normal View History

2019-03-28 11:59:31 -04:00
Q_State_DEF(Table, initial) {
2012-08-14 18:00:48 -04:00
uint8_t n;
2019-03-28 11:59:31 -04:00
subscribe(HUNGRY_SIG); // subscribe to HUNGRY
subscribe(DONE_SIG); // subscribe to DONE
subscribe(TERMINATE_SIG); // subscribe to TERMINATE
2012-08-14 18:00:48 -04:00
for (n = 0; n < N; ++n) {
2019-03-28 11:59:31 -04:00
m_fork_[n] = FREE;
m_isHungry_[n] = 0;
2012-08-14 18:00:48 -04:00
}
2019-03-28 11:59:31 -04:00
return tran(&serving);
2012-08-14 18:00:48 -04:00
}