Source:
<code>public void run() { if (!fStateSystemAssigned) { Activator.logError("Cannot run event manager without assigning a target state system first!"); return; } ITmfEvent event = fEventsQueue.take(); Map<Integer, TmfAttributePool> callstacksAttributePool = new HashMap(); while (event != END_EVENT) { if (event == EMPTY_QUEUE_EVENT) { event = fEventsQueue.take(); continue; } currentEvent = event; long currentTime = event.getTimestamp().toNanos(); fSafeTime = currentTime - 1; ITmfStateSystemBuilder stateSystemBuilder = getStateSystemBuilder(); if (stateSystemBuilder == null) { return; } eventHandle(event); <START> FutureEvent futureEvent = fFutureEvents.peek(); <END> while (futureEvent != null && (currentTime >= futureEvent.fTime)) { futureEvent = fFutureEvents.poll(); if (futureEvent != null) { TmfAttributePool attributePool = callstacksAttributePool.get(futureEvent.fQuark); if (attributePool == null) { attributePool = new TmfAttributePool(stateSystemBuilder, futureEvent.fQuark, QueueType.PRIORITY, 1); callstacksAttributePool.put(futureEvent.fQuark, attributePool); } applyEvent(futureEvent, stateSystemBuilder, attributePool); } futureEvent = fFutureEvents.peek(); } event = fEventsQueue.take(); } fDone = true; ITmfStateSystemBuilder stateSystemBuilder = getStateSystemBuilder(); if (stateSystemBuilder == null) { return; } while (!fFutureEvents.isEmpty()) { FutureEvent futureEvent = fFutureEvents.peek(); while (futureEvent != null) { futureEvent = fFutureEvents.poll(); if (futureEvent != null) { TmfAttributePool attributePool = callstacksAttributePool.get(futureEvent.fQuark); if (attributePool == null) { attributePool = new TmfAttributePool(stateSystemBuilder, futureEvent.fQuark, QueueType.PRIORITY, 1); callstacksAttributePool.put(futureEvent.fQuark, attributePool); } applyEvent(futureEvent, stateSystemBuilder, attributePool); } futureEvent = fFutureEvents.peek(); } } done(); closeStateSystem(); }</code><technical_language>This remain eventHandle call, state system written timestamps >= future time</technical_language>

Target:
public void run() { try (FlowScopeLog log = new FlowScopeLogBuilder(LOGGER, Level.FINE, "AbstractTmfStateProvider:running consumer").setParentScope(fLog).build()) { if (!fStateSystemAssigned) { Activator.logError("Cannot run event manager without assigning a target state system first!"); return; } ITmfEvent event = fEventsQueue.take(); while (event != END_EVENT) { if (event == EMPTY_QUEUE_EVENT) { event = fEventsQueue.take(); continue; } currentEvent = event; long currentTime = event.getTimestamp().toNanos(); fSafeTime = currentTime - 1; ITmfStateSystemBuilder stateSystemBuilder = getStateSystemBuilder(); if (stateSystemBuilder == null) { return; } FutureEvent futureEvent = fFutureEvents.peek(); while (futureEvent != null && (currentTime >= futureEvent.fTime)) { futureEvent = fFutureEvents.poll(); if (futureEvent != null) { applyFutureEvent(futureEvent, stateSystemBuilder); } futureEvent = fFutureEvents.peek(); } eventHandle(event); event = fEventsQueue.take(); } fDone = true; ITmfStateSystemBuilder stateSystemBuilder = getStateSystemBuilder(); if (stateSystemBuilder == null) { return; } while (!fFutureEvents.isEmpty()) { FutureEvent futureEvent = fFutureEvents.peek(); while (futureEvent != null) { futureEvent = fFutureEvents.poll(); if (futureEvent != null) { applyFutureEvent(futureEvent, stateSystemBuilder); } futureEvent = fFutureEvents.peek(); } } done(); closeStateSystem(); } }