qpcpp/doxygen/snippets/qf_subscribe.cpp

13 lines
342 B
C++
Raw Normal View History

2019-03-28 11:59:31 -04:00
Q_State_DEF(Table, initial) {
subscribe(HUNGRY_SIG); // <--- subscribe to HUNGRY
subscribe(DONE_SIG); // <--- subscribe to DONE
subscribe(TERMINATE_SIG); // <--- subscribe to TERMINATE
for (std::uint8_t n = 0U; n < N; ++n) {
2019-03-28 11:59:31 -04:00
m_fork_[n] = FREE;
m_isHungry_[n] = 0U;
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
}