Project

General

Profile

Revision d669a8ab

IDd669a8ab962209f1e9575b0f71b3379a777444b1

Added by Simon Tenbusch almost 9 years ago

[nullduration] added
- runtimeexception when wrong priority is scheduled
- NOBARRIER-threadstate now uses UINT_MAX for barriers

View differences:

src/sim/casyncmodule.cc
52 52
	// needs to be initialized here for use during model initialization
53 53
	//
54 54
	scheduledMessageCount = 0;
55
    currentEventPriority = 0;
55 56

  
56 57
	//
57 58
	// initialize with the current time. This variable is already used when
......
61 62
	// point in time during the simulation.
62 63
	//
63 64
	now = simTime();
65

  
64 66
}
65 67

  
66 68

  
......
163 165
        			"at %s of the scheduling event.",
164 166
        			t.str().c_str(), t_end.str().c_str());
165 167

  
168
        if (t == now && currentEventPriority < msg->getSchedulingPriority()) {
169
            throw cRuntimeError("scheduleAt(): priority of scheduled Event larger than scheduling event and scheduling event and equal starting times => scheduling in the past");
170
        }
166 171
        // insert this message in the FES. When the scheduler arrives at this
167 172
        // message it will trigger the processing of the associated task
168 173
        msg->setSentFrom(this, -1, t_end);
......
231 236
    //
232 237
    t_end = msg->getArrivalTime() + msg->getEventDuration();
233 238
    now = msg->getArrivalTime();
239
    currentEventPriority = msg->getSchedulingPriority();
234 240

  
235 241
    //
236 242
    // take ownership of the message only after the test above
......
243 249
    scheduledMessageCount = 0;
244 250

  
245 251
    executionOrderId = msg->getExecutionOrderId();
252

  
246 253
}
247 254

  
248 255
int cAsyncModule::send(cMessage *msg, int gateid)
......
341 348
        if (arrivalTime < t_end) // TODO: Consider channel delay!
342 349
            throw cRuntimeError("sendDelayed(): send delay shorter than processing delay %s", delay.str().c_str());
343 350

  
351
        if (delay == 0 && currentEventPriority < msg->getSchedulingPriority()) {
352
            throw cRuntimeError("sendDelayed(): priority of scheduled Event larger than scheduling event and scheduling event and equal starting times => scheduling in the past");
353
        }
344 354
        //
345 355
        // set message parameters and send it
346 356
        //
......
435 445

  
436 446
        simtime_t arrivalTime = now + delay;
437 447
        if (arrivalTime < t_end) // TODO: Consider channel delay!
438
            throw cRuntimeError("sendDelayed(): send delay shorter than processing delay %s",delay.str().c_str());
448
            throw cRuntimeError("sendDirect(): send delay shorter than processing delay %s",delay.str().c_str());
449

  
450
        if (delay == 0 && currentEventPriority < msg->getSchedulingPriority()) {
451
            throw cRuntimeError("sendDirect(): priority of scheduled Event larger than scheduling event and scheduling event and equal starting times => scheduling in the past");
452
        }
439 453

  
440 454
        // set message parameters and send it
441 455
        msg->setSentFrom(this, -1, now);

Also available in: Unified diff