当前位置: 首页>>代码示例>>C++>>正文


C++ OsEvent类代码示例

本文整理汇总了C++中OsEvent的典型用法代码示例。如果您正苦于以下问题:C++ OsEvent类的具体用法?C++ OsEvent怎么用?C++ OsEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OsEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleMessage

    UtlBoolean handleMessage(OsMsg& rMsg)
    {
        int waitMsec = rand();
        delay((waitMsec % 3 ) * 50);

        OsEvent* event = ((OsRpcMsg&)rMsg).getEvent();
        CPPUNIT_ASSERT(event);
   
        mNumEvents++;
        int eventIndex =-1;
        event->getUserData(eventIndex);
        //CPPUNIT_ASSERT(mNumEvents == eventIndex);
        CPPUNIT_ASSERT(mNumEvents < mMaxEvents);

        OsStatus eventStat = event->signal(mNumEvents);
        if(eventStat == OS_ALREADY_SIGNALED)
        {
           // The Right side lost, the Left side is done
           // we delete on this side
           delete event;
           event = NULL;
           mpDeletedEvent[mNumEvents] = TRUE;
        }
        else
        {
           // This/Right side won. we do nothing
           mpDeletedEvent[mNumEvents] = FALSE;
           //osPrintf("Right: %d\n", eventStat);
        }
        return(TRUE);
    }
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:31,代码来源:OsEventTest.cpp

示例2: CHECK_VALIDITY

// Disarm the timer
OsStatus OsTimer::stop(UtlBoolean synchronous)
{
#ifndef NDEBUG
   CHECK_VALIDITY(this);
#endif

   OsStatus result;
   UtlBoolean sendMessage = FALSE;

   // Update members.
   {
      OsLock lock(mBSem);

#ifndef NDEBUG
      assert(!mDeleting);
#endif

      // Determine whether the call is successful.
      if (isStarted(mApplicationState))
      {
         mWasFired = FALSE;
         // Update state to stopped.
         mApplicationState++;
         result = OS_SUCCESS;
         if (mOutstandingMessages == 0)
         {
            // We will send a message.
            sendMessage = TRUE;
            mOutstandingMessages++;
         }
      }
      else
      {
         result = OS_FAILED;
      }
   }

   // If we need to, send an UPDATE message to the timer task.
   if (sendMessage)
   {
      if (synchronous) {
         // Send message and wait.
         OsEvent event;
         OsTimerMsg msg(OsTimerMsg::OS_TIMER_UPDATE_SYNC, this, &event);
         OsStatus res = OsTimerTask::getTimerTask()->postMessage(msg);
         assert(res == OS_SUCCESS);
         event.wait();
      }
      else
      {
         // Send message.
         OsTimerMsg msg(OsTimerMsg::OS_TIMER_UPDATE, this, NULL);
         OsStatus res = OsTimerTask::getTimerTask()->postMessage(msg);
         assert(res == OS_SUCCESS);
      }
   }

   return result;
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:60,代码来源:OsTimer.cpp

示例3: switch

// Handle an incoming message
// Return TRUE if the message was handled, otherwise FALSE.
UtlBoolean MpMediaTask::handleMessage(OsMsg& rMsg)
{
   UtlBoolean           handled;
   MpFlowGraphBase*    pFlowGraph;
   MpMediaTaskMsg*     pMsg;

   if (rMsg.getMsgType() != OsMsg::MP_TASK_MSG)
      return FALSE;    // the method only handles MP_TASK_MSG messages

   pMsg = (MpMediaTaskMsg*) &rMsg;
   pFlowGraph = (MpFlowGraphBase*) pMsg->getPtr1();

   handled = TRUE;     // until proven otherwise, assume we'll handle the msg

   switch (pMsg->getMsg())
   {
   case MpMediaTaskMsg::MANAGE:
      {
         OsEvent* event = (OsEvent*)pMsg->getPtr2();
         if (!handleManage(pFlowGraph))
            mHandleMsgErrs++;
         if (event) event->signal(0);
         break;
      }
   case MpMediaTaskMsg::SET_FOCUS:
      if (!handleSetFocus(pFlowGraph))
         mHandleMsgErrs++;
      break;
   case MpMediaTaskMsg::START:
      if (!handleStart(pFlowGraph))
         mHandleMsgErrs++;
      break;
   case MpMediaTaskMsg::STOP:
      if (!handleStop(pFlowGraph))
         mHandleMsgErrs++;
      break;
   case MpMediaTaskMsg::UNMANAGE:
      {
         OsEvent* event = (OsEvent*)pMsg->getPtr2();
         if (!handleUnmanage(pFlowGraph))
            mHandleMsgErrs++;
         if (event) event->signal(0);
         break;
      }
   case MpMediaTaskMsg::WAIT_FOR_SIGNAL:
      if (!handleWaitForSignal(pMsg))
         mHandleMsgErrs++;
      break;
   default:
      handled = FALSE; // we didn't handle the message after all
      break;
   }

   return handled;
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:57,代码来源:MpMediaTask.cpp

示例4: unmanageFlowGraph

// Directs the media processing task to remove the flow graph from its 
// set of managed flow graphs.
// If the flow graph is not already in the MpFlowGraphBase::STOPPED state,
// then the flow graph will be stopped before it is removed from the set
// of managed flow graphs.
// Returns OS_SUCCESS to indicate that the media task will stop managing
// the indicated flow graph at the start of the next frame processing
// interval.
OsStatus MpMediaTask::unmanageFlowGraph(MpFlowGraphBase& rFlowGraph)
{
   OsEvent event;
   MpMediaTaskMsg msg(MpMediaTaskMsg::UNMANAGE, &rFlowGraph, &event);
   OsStatus res;

   res = postMessage(msg, OsTime::NO_WAIT_TIME);
   assert(res == OS_SUCCESS);
   // wait until flowgraph is unmanaged
   event.wait();

   return OS_SUCCESS;
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:21,代码来源:MpMediaTask.cpp

示例5: msg

// Destructor
OsTimerTask::~OsTimerTask()
{
   if (sInstance.isStarted())
   {
      // Shut down the task.
      OsEvent event;
      OsTimerTaskCommandMsg msg(OsTimerTaskCommandMsg::OS_TIMER_SHUTDOWN, NULL, &event);
      // Send the OS_TIMER_SHUTDOWN message.
      OsStatus res = OsTimerTask::getTimerTask()->postMessage(msg);
      assert(res == OS_SUCCESS);
      // Wait for the response.
      event.wait();
   }
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:15,代码来源:OsTimerTask.cpp

示例6: testThreadedMultipleFire

    void testThreadedMultipleFire()
    {
        OsEvent event;
        MultipleFireThread fireThread(-1, &event);

        fireThread.start();

        for (int i=0; i<10000; i++)
        {
           CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, event.wait(500));
           CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, event.reset());
        }

        fireThread.requestShutdown();
    }
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:15,代码来源:OsEventTest.cpp

示例7: run

int ClientTask::run(void* runArg)
{
    OsEvent* pEvent = (OsEvent*)runArg;
    OsStatus status;
    
    fileExecute(InputFile, false);
    
    do {
        //printf("%s is signaling\n", mName.data());
        status = pEvent->signal(1);
    } 
    while (status == OS_ALREADY_SIGNALED);
   
    return 0;
}
开发者ID:mranga,项目名称:sipxecs,代码行数:15,代码来源:configrpc.cpp

示例8: destroyTimerTask

// Destroy the singleton instance of the timer task.
void OsTimerTask::destroyTimerTask(void)
{
    OsSysLog::add(FAC_KERNEL, PRI_DEBUG,
                  "OsTimerTask::destroyTimerTask entered");

    if (sInstance.isStarted())
    {
       OsEvent event;
       OsTimerTaskCommandMsg msg(OsTimerTaskCommandMsg::OS_TIMER_SHUTDOWN, NULL, &event);
       // Send the OS_TIMER_SHUTDOWN message.
       OsStatus res = OsTimerTask::getTimerTask()->postMessage(msg);
       assert(res == OS_SUCCESS);
       // Wait for the response.
       event.wait();
    }
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:17,代码来源:OsTimerTask.cpp

示例9: manageFlowGraph

// Directs the media processing task to add the flow graph to its 
// set of managed flow graphs.  The flow graph must be in the 
// MpFlowGraphBase::STOPPED state when this method is invoked.
// Returns OS_INVALID_ARGUMENT if the flow graph is not in the STOPPED state.
// Otherwise returns OS_SUCCESS to indicate that the flow graph will be added
// to the set of managed flow graphs at the start of the next frame
// processing interval.
OsStatus MpMediaTask::manageFlowGraph(MpFlowGraphBase& rFlowGraph)
{
   OsEvent event;
   MpMediaTaskMsg msg(MpMediaTaskMsg::MANAGE, &rFlowGraph, &event);
   OsStatus       res;

   if (rFlowGraph.getState() != MpFlowGraphBase::STOPPED) {
      // PRINTF("MpMediaTask::manageFlowGraph: error!\n", 0,0,0,0,0,0);
      return OS_INVALID_ARGUMENT;
   }

   res = postMessage(msg, OsTime::NO_WAIT_TIME);
   assert(res == OS_SUCCESS);
   // wait until flowgraph is managed
   event.wait();

   return OS_SUCCESS;
}
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:25,代码来源:MpMediaTask.cpp

示例10: testTimedEvent

    void testTimedEvent()
    {
        OsTime   eventTimeout(2,0);
        OsEvent* pEvent;

        pEvent = new OsEvent(12345);
        time_t epochTime = time(NULL);
        CPPUNIT_ASSERT(pEvent->wait(eventTimeout) != OS_SUCCESS);
        pEvent->signal(67890);
        CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, pEvent->wait(eventTimeout));
        pEvent->reset();
        CPPUNIT_ASSERT(pEvent->wait(eventTimeout) != OS_SUCCESS);
        epochTime = time(NULL) - epochTime;
   
        // Make sure we waited (approximately) 2 seconds each time.
        CPPUNIT_ASSERT(epochTime > 2 && epochTime < 6);
   
        delete pEvent;
    }
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:19,代码来源:OsEventTest.cpp

示例11: testThreadedEvent

    void testThreadedEvent()
    {
        // Seed the random number generator
        srand(OsDateTime::getSecsSinceEpoch());

        int numTries = 100;
        int* rightResults = new int[numTries];
        int* leftResults = new int[numTries];

        // Create the Right thread.  This context will be the
        // Left thread.
        RightEventThread rightThread(rightResults, numTries);
        rightThread.start();

        int index;
        for(index = 0; index < numTries; index++)
        {
            OsEvent* event = new OsEvent(index);
            OsRpcMsg eventMsg(OsMsg::USER_START,0,*event);
            rightThread.postMessage(eventMsg);

            int waitTimeMsec = (rand() % 3) * 110;
            OsTime time(0, waitTimeMsec * 1000);
            event->wait(time);

            OsStatus eventStat = event->signal(index);
            if(eventStat == OS_ALREADY_SIGNALED)
            {
                // We (Left) lost the other side is done
                int eventData;
                event->getEventData(eventData);
                CPPUNIT_ASSERT(eventData == index);

                // This/Left side deletes the event
                delete event;
                event = NULL;
               leftResults[index] = TRUE;
            }
            else
            {
                // The other/Right side lost
                // Do nothing
                leftResults[index] = FALSE;
                //osPrintf("Left: %d\n", eventStat);
            }
        }

        OsTask::delay(1000);

        int leftDeletes = 0;
        int rightDeletes = 0;
        for(index = 0; index < numTries; index++)
        {
            if(leftResults[index] == TRUE)
            {
                leftDeletes++;
            }
            if(rightResults[index] == TRUE)
            {
                rightDeletes++;
            }
            if(rightResults[index] == leftResults[index])
            {
               //osPrintf("Left deleted: %d Right deleted: %d\n",
               //           leftDeletes, rightDeletes);
               //osPrintf("[%d]: Both sides %s\n", index, 
               //        rightResults[index] ? "Deleted" : "Did not delete");
            }
            CPPUNIT_ASSERT(rightResults[index] != leftResults[index]);
        }

        //osPrintf("Left deleted: %d Right deleted: %d\n",
        //        leftDeletes, rightDeletes);

        CPPUNIT_ASSERT(leftDeletes + rightDeletes == numTries);
    }
开发者ID:Jaroslav23,项目名称:sipxtapi,代码行数:76,代码来源:OsEventTest.cpp

示例12: realize

// Realizes the player by initiating a connection to the target, allocates
// buffers, etc.
OsStatus MpStreamPlayer::realize(UtlBoolean bBlock /* = TRUE */)
{
   OsStatus status = OS_FAILED ;
   OsEvent eventHandle ;
   intptr_t eventData ;

   // Only proceed if we have a flow graph and the player is unrealized.
   if (getState() == PlayerUnrealized)
   {
      // Create an mpQueueEvent object to signal state changes in from
      // the MpStreamFeeder
      mpQueueEvent =  new OsQueuedEvent(*getMessageQueue(), 0);

      // Realize the stream
      if (mSourceType == SourceUrl)
      {
         if (mpMsgQ != NULL)
         {
            MpStreamMsg msg(MpStreamMsg::STREAM_REALIZE_URL, mTarget, NULL,
                  &eventHandle, mpQueueEvent, mFlags, (intptr_t) new Url(mUrl)) ;
            status = mpMsgQ->send(msg) ;
         }
      }
      else if (mSourceType == SourceBuffer)
      {

         if (mpMsgQ != NULL)
         {
            MpStreamMsg msg(MpStreamMsg::STREAM_REALIZE_BUFFER, mTarget, NULL,
                  &eventHandle, mpQueueEvent, mFlags, (intptr_t) mpBuffer) ;
            status = mpMsgQ->send(msg) ;
         }
      }

      if (status == OS_SUCCESS)
      {
         // Wait for a response
         status = eventHandle.wait(OsTime(MAX_REALIZE_WAIT, 0)) ;
         if (status == OS_SUCCESS)
         {
            if (eventHandle.getEventData(eventData) == OS_SUCCESS)
            {
               mHandle = (StreamHandle) eventData ;
			   if (mHandle != 0)
			      mbRealized = TRUE ;
            }
            else
            {
               mHandle = NULL ;
            }
         }
         else
         {
            mHandle = NULL ;
         }
      }
   }

   if (mHandle == 0)
   {
      mState = PlayerDestroyed ;
      status = OS_FAILED ;
      mSemStateChange.release() ;
   }

   if (status == OS_SUCCESS)
   {
      // Start Server task if successfull
      if (start() == TRUE)
      {
         // Block while waiting for prefetch (if requested)
         if (bBlock)
         {
            while (getState() == PlayerUnrealized)
            {
               mSemStateChange.acquire();
            }
         }
         else
         {
            // Wait for task to startup
            while (!isStarted())
            {
               OsTask::yield() ;
            }
         }
      }
      else
      {
         syslog(FAC_STREAMING, PRI_CRIT, "Failed to create thread for MpStreamPlayer") ;

         // Unable to create thread; attempt to clean up
         status = OS_FAILED ;

         MpStreamMsg msgStop(MpStreamMsg::STREAM_STOP, mTarget, mHandle);
         mpMsgQ->send(msgStop) ;
         MpStreamMsg msgDestroy(MpStreamMsg::STREAM_DESTROY, mTarget, mHandle);
         mpMsgQ->send(msgDestroy) ;
//.........这里部分代码省略.........
开发者ID:astubbs,项目名称:sipxecs,代码行数:101,代码来源:MpStreamPlayer.cpp

示例13: clientExists

UtlBoolean SipProtocolServerBase::waitForClientToWrite(SipClient* client)
{
    UtlBoolean exists;
    UtlBoolean busy = FALSE;
    int numTries = 0;

    do
    {
        numTries++;

        mClientLock.acquireWrite();
        exists = clientExists(client);

        if(exists)
        {
            busy =  client->isInUseForWrite();
            if(!busy)
            {
                client->markInUseForWrite();
                mClientLock.releaseWrite();
                if(numTries > 1)
                {
                   OsSysLog::add(FAC_SIP, PRI_DEBUG,
                                 "Sip%sServerBase::waitForClientToWrite %p locked after %d tries",
                                 mProtocolString.data(), client, numTries);
                }
            }
            else
            {
                // We set an event to be signaled when a
                // transaction is released.
                OsEvent* waitEvent = new OsEvent();
                client->notifyWhenAvailableForWrite(*waitEvent);

                // Must unlock while we wait or there is a dead lock
                mClientLock.releaseWrite();
#ifdef TEST_PRINT
                OsSysLog::add(FAC_SIP, PRI_DEBUG,
                              "Sip%sServerBase::waitForClientToWrite %p "
                              "waiting on: %p after %d tries",
                              mProtocolString.data(), client, waitEvent, numTries);
#endif

                // Do not block forever
                OsTime maxWaitTime(0, 500000);

                // If the other side signaled
                if(waitEvent->wait(maxWaitTime)  == OS_SUCCESS)
                {
                    // The other side is no longer referencing
                    // the event.  This side must clean it up
                    delete waitEvent;
                    waitEvent = NULL;
                }
                // A timeout occurred and the other side did not signal yet
                else
                {
                    // Signal the other side to indicate we are done
                    // with the event.  If already signaled, we lost
                    // a race and the other side was done first.
                    if(waitEvent->signal(0) == OS_ALREADY_SIGNALED)
                    {
                        delete waitEvent;
                        waitEvent = NULL;
                    }
                }

#ifdef TEST_PRINT
                OsSysLog::add(FAC_SIP, PRI_DEBUG,
                              "Sip%sServerBase::waitForClientToWrite %p done waiting after %d tries",
                              mProtocolString.data(), client, numTries);
#endif
            }
        }
        else
        {
            mClientLock.releaseWrite();

            OsSysLog::add(FAC_SIP, PRI_ERR,
                          "Sip%sServerBase::waitForClientToWrite %p gone after %d tries",
                          mProtocolString.data(), client, numTries);
        }
    }
    while(exists && busy);

    return(exists && !busy);
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:87,代码来源:SipProtocolServerBase.cpp

示例14: playListDbIterator

// Realizes the player by initiating a connection to the target, allocates
// buffers, etc.
OsStatus MpStreamPlaylistPlayer::realize(UtlBoolean bBlock)
{
   OsStatus status = OS_FAILED;
   PlayListEntry* e;

   if (mAggregateState == PlayerFailed)
   {
      OsSysLog::add(FAC_MP, PRI_ERR, "MpStreamPlaylistPlayer::realize failure, mAggregateState == PlayerFailed");
      return status;
   }

   // Start prefetching all of the elements
   UtlSListIterator playListDbIterator(*mPlayListDb) ;
   while((e = (PlayListEntry*)playListDbIterator()))
   {
//      OsSysLog::add(FAC_MP, PRI_DEBUG, "MpStreamPlaylistPlayer::realize entry[%d] state %d", e->index, e->state);

      if (e->state == PlayerUnrealized)
      {
         OsEvent eventHandle;

         // Realize the stream
         if (e->sourceType == SourceUrl)
         {
            MpStreamMsg msg(MpStreamMsg::STREAM_REALIZE_URL,
                            mTarget,
                            NULL,
                            &eventHandle,
                            e->pQueuedEvent,
                            e->flags,
                            (intptr_t) new Url(e->url));
            status = mpMsgQ->send(msg);
            if (status != OS_SUCCESS)
            {
               setEntryState(e, PlayerFailed);
               e->handle = NULL;
               OsSysLog::add(FAC_MP, PRI_ERR, "MpStreamPlaylistPlayer::realize failed on send of MpStreamMsg::STREAM_REALIZE_URL message");
            }
         }
         else if (e->sourceType == SourceBuffer)
         {
            MpStreamMsg msg(MpStreamMsg::STREAM_REALIZE_BUFFER,
                            mTarget,
                            NULL,
                            &eventHandle,
                            e->pQueuedEvent,
                            e->flags,
                            (intptr_t) e->pBuffer);
            status = mpMsgQ->send(msg);
            if (status != OS_SUCCESS)
            {
               setEntryState(e, PlayerFailed);
               e->handle = NULL;
               delete e->pBuffer;
               e->pBuffer = NULL;
               OsSysLog::add(FAC_MP, PRI_ERR, "MpStreamPlaylistPlayer::realize failed on send of MpStreamMsg::STREAM_REALIZE_BUFFER message");
            }
         }

         if (status == OS_SUCCESS)
         {
            // Wait for a response
            intptr_t eventData;
            status = eventHandle.wait(mRealizeTimeout);
            if (status == OS_SUCCESS)
               status = eventHandle.getEventData(eventData);
            if (status == OS_SUCCESS)
            {
               e->handle = (StreamHandle) eventData;
            }
            else
            {
               setEntryState(e, PlayerFailed);
               e->handle = NULL;
               if (e->sourceType == SourceBuffer)
               {
                  delete e->pBuffer;
                  e->pBuffer = NULL;
               }
               OsSysLog::add(FAC_MP, PRI_ERR, "MpStreamPlaylistPlayer::realize STREAM_REALIZE_ request failed");
            }
         }
      }
   }

   // Block if requested
   playListDbIterator.reset();
   if ((status == OS_SUCCESS) && bBlock)
   {
      while((e = (PlayListEntry*)playListDbIterator()) != NULL &&
               (mAggregateState != PlayerFailed))
      {
         while (e->state == PlayerUnrealized)
         {
            status = mSemStateChange.acquire(mRealizeTimeout);
            if (status == OS_WAIT_TIMEOUT)
            {
               setEntryState(e, PlayerFailed);
//.........这里部分代码省略.........
开发者ID:astubbs,项目名称:sipxecs,代码行数:101,代码来源:MpStreamPlaylistPlayer.cpp

示例15: lock

UtlBoolean SipTransactionList::waitUntilAvailable(SipTransaction* transaction,
                                                 const UtlString& hash)
{
    UtlBoolean exists;
    UtlBoolean busy = FALSE;
    int numTries = 0;

    do
    {
        numTries++;

        lock();
        exists = transactionExists(transaction, hash);

        if(exists)
        {
            busy =  transaction->isBusy();
            if(!busy)
            {
                transaction->markBusy();
                unlock();
//#ifdef TEST_PRINT
                OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipTransactionList::waitUntilAvailable %p locked after %d tries\n",
                    transaction, numTries);
//#endif
            }
            else
            {
                // We set an event to be signaled when a
                // transaction is released.
                OsEvent* waitEvent = new OsEvent;
                transaction->notifyWhenAvailable(waitEvent);

                // Must unlock while we wait or there is a dead lock
                unlock();

//#ifdef TEST_PRINT
                OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipTransactionList::waitUntilAvailable %p waiting on: %p after %d tries\n",
                    transaction, waitEvent, numTries);
//#endif

                OsStatus waitStatus;
                OsTime transBusyTimeout(1, 0);
                int waitTime = 0;
                do
                {
                    if(waitTime > 0)
                        OsSysLog::add(FAC_SIP, PRI_WARNING, "SipTransactionList::waitUntilAvailable %p still waiting: %d",
                            transaction, waitTime);

                    waitStatus = waitEvent->wait(transBusyTimeout);
                    waitTime+=1;
                }
                while(waitStatus != OS_SUCCESS && waitTime < 30);

                // If we were never signaled, then we signal the
                // event so the other side knows that it has to
                // free up the event
                if(waitEvent->signal(-1) == OS_ALREADY_SIGNALED)
                {
                    delete waitEvent;
                    waitEvent = NULL;
                }

                // If we bailed out before the event was signaled
                // pretend the transaction does not exist.
                if(waitStatus != OS_SUCCESS)
                {
                    exists = FALSE;
                }

                if(waitTime > 1)
                {
                    if (OsSysLog::willLog(FAC_SIP, PRI_WARNING))
                    {
                        UtlString transTree;
                        UtlString waitingTaskName;
                        OsTask* waitingTask = OsTask::getCurrentTask();
                        if(waitingTask) waitingTaskName = waitingTask->getName();
                        transaction->dumpTransactionTree(transTree, FALSE);
                        OsSysLog::add(FAC_SIP, PRI_WARNING, "SipTransactionList::waitUntilAvailable status: %d wait time: %d transaction: %p task: %s transaction tree: %s",
                            waitStatus, waitTime, transaction, waitingTaskName.data(), transTree.data());
                    }
                }

//#ifdef TEST_PRINT
                OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipTransactionList::waitUntilAvailable %p done waiting after %d tries\n",
                    transaction, numTries);
//#endif
            }
        }
        else
        {
            unlock();
//#ifdef TEST_PRINT
            OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipTransactionList::waitUntilAvailable %p gone after %d tries\n",
                    transaction, numTries);
//#endif
        }
    }
//.........这里部分代码省略.........
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:101,代码来源:SipTransactionList.cpp


注:本文中的OsEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。