qpcpp/doxygen/snippets/qf_postx.cpp

25 lines
586 B
C++
Raw Normal View History

2013-10-10 20:01:51 -04:00
extern QActive *AO_Table;
Q_STATE_DEF(Philo, hungry) {
2013-10-10 20:01:51 -04:00
QP::QState status_;
switch (e->sig) {
case Q_ENTRY_SIG: {
TableEvt *pe = Q_NEW_X(TableEvt, 5U, /* <- margin */
HUNGRY_SIG);
2020-03-17 21:33:58 -04:00
if (te != nullptr) {
pe->philoNum = PHILO_ID(this);
AO_Table->POST_X(pe, 2U, this); // <----
2013-10-10 20:01:51 -04:00
}
status_ = Q_RET_HANDLED;
2013-10-10 20:01:51 -04:00
break;
}
. . .
default: {
status_ = super(&top);
2013-10-10 20:01:51 -04:00
break;
}
}
return status_;
2013-10-10 20:01:51 -04:00
}