Revision e1750c09

View differences:

src/sim/cscheduler.cc
61 61
    //
62 62
    // If we retrieve a valid msg from the queue, we return it:
63 63
    //
64
    cMessage *msg = sim->msgQueue.removeFirst();
64
    cMessage *msg = sim->msgQueue.peekFirst();
65 65

  
66 66
    if (msg)
67 67
        return msg;
......
81 81
    {
82 82
        __asm__ ("pause");
83 83
    }
84
    msg = sim->msgQueue.removeFirst();
84
    msg = sim->msgQueue.peekFirst();
85 85

  
86 86
    //
87 87
    // If there is a msg now, we return it:
......
102 102

  
103 103
    while (!msg)
104 104
    {
105
        msg = sim->msgQueue.removeFirst();
105
        msg = sim->msgQueue.peekFirst();
106 106
        if (!msg)
107 107
            throw cTerminationException(eENDEDOK);
108 108

  
......
166 166
    }
167 167

  
168 168
    updateIES();
169
    return getFirstEvent();
169
    cMessage* msg=getFirstEvent();
170
	sim->msgQueue.insert(msg);
171
	return msg;
170 172
}
171 173

  
172 174
void cEEFScheduler::updateIES() {
......
383 385
        //TODO: Handle barriermsg
384 386
        throw cRuntimeError("RealTimeScheduler is not supported with Threadpool.");
385 387
    }
386
    cMessage *msg = sim->msgQueue.removeFirst();
388
    cMessage *msg = sim->msgQueue.peekFirst();
387 389
    if (!msg)
388 390
        throw cTerminationException(eENDEDOK);
389 391

  
src/sim/csimulation.cc
686 686
		}
687 687

  
688 688
		bool mayPar = mod->mayParallelize(msg, duration);
689

  
690
		cMessage *msg2=msgQueue.removeFirst();
691
		assert(msg==msg2);
692

  
689 693
		// execute this event in parallel
690 694
		if (mayPar && threaded && !sequentialExecution)
691 695
		{

Also available in: Unified diff