mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-28 06:02:56 +08:00
23 lines
551 B
C++
23 lines
551 B
C++
extern QActive *AO_Table;
|
|
|
|
QP::QState Philo::hungry(Philo * const me, QP::QEvt const * const e) {
|
|
QP::QState status_;
|
|
switch (e->sig) {
|
|
case Q_ENTRY_SIG: {
|
|
TableEvt *te;
|
|
Q_NEW_X(te, TableEvt, 1U, HUNGRY_SIG, PHILO_ID(me));
|
|
if (te != nullptr) {
|
|
AO_Table->POST_X(te, 1U, me);
|
|
}
|
|
status_ = Q_HANDLED();
|
|
break;
|
|
}
|
|
. . .
|
|
default: {
|
|
status = Q_SUPER(&QHsm::top);
|
|
break;
|
|
}
|
|
}
|
|
return status;
|
|
}
|