mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-28 06:02:56 +08:00
34cdcc7929
major release 7.0.0 release candidate 1
25 lines
586 B
C++
25 lines
586 B
C++
extern QActive *AO_Table;
|
|
|
|
|
|
Q_STATE_DEF(Philo, hungry) {
|
|
QP::QState status_;
|
|
switch (e->sig) {
|
|
case Q_ENTRY_SIG: {
|
|
TableEvt *pe = Q_NEW_X(TableEvt, 5U, /* <- margin */
|
|
HUNGRY_SIG);
|
|
if (te != nullptr) {
|
|
pe->philoNum = PHILO_ID(this);
|
|
AO_Table->POST_X(pe, 2U, this); // <----
|
|
}
|
|
status_ = Q_RET_HANDLED;
|
|
break;
|
|
}
|
|
. . .
|
|
default: {
|
|
status_ = super(&top);
|
|
break;
|
|
}
|
|
}
|
|
return status_;
|
|
}
|