Project

General

Profile

Revision f40e1183

IDf40e118385356debad57b2a0d87b9c59f14952ac

Added by Georg Kunz about 9 years ago

[core] cleanup of execution state handling within casynchmodule

View differences:

include/casyncmodule.h
46 46
class SIM_API cAsyncModule : public cSimpleModule
47 47
{
48 48
  private:
49
    // the module is idling, i.e., no event is current executed
50
    static const AO_t idleExecution = 0;
51 49

  
52
    // the module is currently executing a synchronous event
53
    static const AO_t syncExecution = 1;
54

  
55
    // the module is currently executing an asynchronous event
56
    static const AO_t asyncExecution = 2;
50
    // the two different execution states: either handleMessage is called
51
    // synchronously by the scheduler or asynchronously (to the scheduler)
52
    // by a worker thread
53
    enum ExecutionStates
54
    {
55
        synchronous,
56
        asynchronous
57
    };
57 58

  
58
    // keeps the current state of the module
59
    AO_t execState;
59
    // current state of execution
60
    ExecutionStates executionState;
60 61

  
61 62
    // new messages may only be scheduled with timestamps >= this value
62 63
    simtime_t t_end;
......
73 74
    // flag indicating that a thread is processing an event within this module
74 75
    AO_t busy;
75 76

  
77
    // how many messages did a given event send?
78
    unsigned int sentMessageCount;
79

  
80
    /**
81
     * update meta data needed for event execution
82
     */
83
    void prepareHandleMessage(cMessage* msg);
76 84

  
77 85
  protected:
78 86
    // the central number generator of this module

Also available in: Unified diff