Revision aeae20a1

View differences:

configure.user
18 18
#    yes -> no NOT use barrier messages
19 19
#    no  -> use barrier messages
20 20
#
21
NOBARRIER=no
21
NOBARRIER=yes
22 22

  
23 23
#
24 24
# In combination with NOBARRIER: Define the cache line size used for aligning
include/cscheduler.h
102 102
     * while getNextEvent() was waiting for external synchronization.
103 103
     */
104 104
    virtual cMessage *getNextEvent() = 0;
105

  
106
    /*
107
     * returns the first msg in the msg queue
108
     */
109
    virtual cMessage *removeNextEvent();
110 105
};
111 106

  
112 107
/**
......
191 186
 *
192 187
 * @ingroup Internals
193 188
 */
189

  
194 190
class SIM_API cRealTimeScheduler : public cScheduler
195 191
{
196 192
  protected:
src/sim/cscheduler.cc
46 46
{
47 47
    sim = _sim;
48 48
}
49
cMessage* cScheduler::removeNextEvent()
50
{
51
    return sim->msgQueue.removeFirst();
52
}
53 49
//-----
54 50

  
55 51
Register_Class(cSequentialScheduler);
......
60 56
    //
61 57
    // If we retrieve a valid msg from the queue, we return it:
62 58
    //
63
    cMessage *msg = sim->msgQueue.peekFirst();
59
    cMessage *msg = sim->msgQueue.removeFirst();
64 60
    if (msg)
65 61
        return msg;
66 62

  
......
78 74
    {
79 75
        __asm__ ("pause");
80 76
    }
81
    msg = sim->msgQueue.peekFirst();
77
    msg = sim->msgQueue.removeFirst();
82 78

  
83 79
    //
84 80
    // If there is a msg now, we return it:
......
259 255
}
260 256

  
261 257

  
258

  
259

  
262 260
//-----
263 261
Register_Class(cRealTimeScheduler);
264 262

  
src/sim/csimulation.cc
647 647
            barrierMin = threadPool->waitAtBarrier(barrierMin, &msgQueue);
648 648
        }
649 649
#endif
650
#ifdef NOBARRIER
651
        // Event is free for scheduling => Remove it from the queue.
652
        msg = msgQueue.removeFirst();
653
#else
654
        //msg = schedulerp->removeNextEvent();
655 650
        msg = schedulerp->getNextEvent();
656 651
        //Advance Simulation Time
657 652
        cThreadPool::setSimTime(msg->getArrivalTime());
658 653

  
659
#endif
660
#ifdef NOBARRIER
661
        cThreadPool::setSimTime(msg->getArrivalTime());
662
#else
654
#ifndef NOBARRIER
663 655
        // check if this is an barrier message indicating the end of an event
664 656
        cBarrierMessage* barrier = dynamic_cast<cBarrierMessage*> (msg);
665 657
        if (barrier != NULL) {

Also available in: Unified diff