sim_events.cc (7820:4ee66d8c1dd8) sim_events.cc (7821:f1d298b7416c)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 71 unchanged lines hidden (view full) ---

80void
81exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat)
82{
83 Event *event = new SimLoopExitEvent(message, exit_code, repeat);
84 mainEventQueue.schedule(event, when);
85}
86
87CountedDrainEvent::CountedDrainEvent()
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 71 unchanged lines hidden (view full) ---

80void
81exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat)
82{
83 Event *event = new SimLoopExitEvent(message, exit_code, repeat);
84 mainEventQueue.schedule(event, when);
85}
86
87CountedDrainEvent::CountedDrainEvent()
88 : SimLoopExitEvent("Finished drain", 0), count(0)
88 : count(0)
89{ }
90
91void
92CountedDrainEvent::process()
93{
94 if (--count == 0)
89{ }
90
91void
92CountedDrainEvent::process()
93{
94 if (--count == 0)
95 exitSimLoop(cause, code);
95 exitSimLoop("Finished drain", 0);
96}
97
98//
99// constructor: automatically schedules at specified time
100//
101CountedExitEvent::CountedExitEvent(const std::string &_cause, int &counter)
102 : Event(Sim_Exit_Pri), cause(_cause), downCounter(counter)
103{

--- 22 unchanged lines hidden ---
96}
97
98//
99// constructor: automatically schedules at specified time
100//
101CountedExitEvent::CountedExitEvent(const std::string &_cause, int &counter)
102 : Event(Sim_Exit_Pri), cause(_cause), downCounter(counter)
103{

--- 22 unchanged lines hidden ---