Exemplo n.º 1
0
 //-------------------------------------------------------------------------
 MessageQueue::MessageQueue(
                            const make_private &,
                            IMessageQueueNotifyPtr notify
                            ) :
   mNotify(notify)
 {
   ZS_EVENTING_1(x, i, Trace, MessageQueueCreate, zs, MessageQueue, Start, this, this, this);
 }
Exemplo n.º 2
0
    //-------------------------------------------------------------------------
    void MessageQueue::post(IMessageQueueMessageUniPtr message)
    {
      ZS_EVENTING_1(x, i, Insane, MessageQueuePost, zs, MessageQueue, Send, this, this, this);

      {
        AutoLock lock(mLock);
        mMessages.push(std::move(message));
      }
      mNotify->notifyMessagePosted();
    }
Exemplo n.º 3
0
    //-------------------------------------------------------------------------
    void MessageQueue::processOnlyOneMessage()
    {
      IMessageQueueMessagePtr message;

      {
        AutoLock lock(mLock);
        if (0 == mMessages.size())
          return;
        message = std::move(mMessages.front());
        mMessages.pop();
      }

      ZS_EVENTING_1(x, i, Insane, MessageQueueProcess, zs, MessageQueue, Receive, this, this, this);

      // process the next message
      message->processMessage();
    }
Exemplo n.º 4
0
    //-------------------------------------------------------------------------
    ORTC::~ORTC()
    {
      mThisWeak.reset();
      ZS_LOG_DETAIL(log("destroyed"));

      ZS_EVENTING_EXCLUSIVE(OrtcLib);
      ZS_EVENTING_0(x, i, Detail, OrtcDestroy, ol, Ortc, Stop);
      ZS_EVENTING_EXCLUSIVE(x);

      ZS_EVENTING_EXCLUSIVE(OrtcLibStatsReport);
      ZS_EVENTING_1(x, i, Detail, OrtcStatsReportCommand, ols, Stats, Start, string, command_name, "stop");
      ZS_EVENTING_ASSIGN_VALUE(OrtcStatsReportCommand, 106);
      ZS_EVENTING_EXCLUSIVE(x);

      ZS_EVENTING_EXCLUSIVE(OrtcLib);
      ZS_EVENTING_UNREGISTER(OrtcLib);
      ZS_EVENTING_EXCLUSIVE(x);

      ZS_EVENTING_EXCLUSIVE(OrtcLibStatsReport);
      ZS_EVENTING_UNREGISTER(OrtcLibStatsReport);
      ZS_EVENTING_EXCLUSIVE(x);
    }
Exemplo n.º 5
0
 //-------------------------------------------------------------------------
 MessageQueue::~MessageQueue()
 {
   ZS_EVENTING_1(x, i, Trace, MessageQueueDestroy, zs, MessageQueue, Stop, this, this, this);
 }