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