}
@Override
public void flush() {
int aid;
IntCircularQueue evtset;
if (lastProp != null) {
aid = p2i.get(lastProp.getId());
if (lastProp.reactToFineEvent()) {
evtset = eventsets[aid];
while (evtset.size() > 0) {
int v = evtset.pollFirst();
eventmasks[aid][v] = 0;
}
evtset.clear();
lastProp.flushPendingEvt();
}
scheduled[aid] = 0;
}
for (int i = nextNotEmpty(0); i > -1; i = nextNotEmpty(i + 1)) {
while (!pro_queue[i].isEmpty()) {
lastProp = pro_queue[i].pollFirst();
// revision of the variable
aid = p2i.get(lastProp.getId());
if (lastProp.reactToFineEvent()) {
evtset = eventsets[aid];
while (evtset.size() > 0) {
int v = evtset.pollFirst();
eventmasks[aid][v] = 0;
}
evtset.clear();
lastProp.flushPendingEvt();
}
scheduled[aid] = 0;
}
notEmpty = notEmpty & ~(1 << i);