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


C++ postTask函数代码示例

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


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

示例1: RELEASE_ASSERT_WITH_SECURITY_IMPLICATION

void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType executionType)
{
    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(scriptLoader);
    switch (executionType) {
    case ASYNC_EXECUTION:
        // RELEASE_ASSERT makes us crash in a controlled way in error cases
        // where the ScriptLoader is associated with the wrong ScriptRunner
        // (otherwise we'd cause a use-after-free in ~ScriptRunner when it tries
        // to detach).
        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_pendingAsyncScripts.contains(scriptLoader));

        m_pendingAsyncScripts.remove(scriptLoader);
        m_asyncScriptsToExecuteSoon.append(scriptLoader);

        postTask(BLINK_FROM_HERE);

        break;

    case IN_ORDER_EXECUTION:
        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_numberOfInOrderScriptsWithPendingNotification > 0);
        m_numberOfInOrderScriptsWithPendingNotification--;

        while (!m_pendingInOrderScripts.isEmpty() && m_pendingInOrderScripts.first()->isReady()) {
            m_inOrderScriptsToExecuteSoon.append(m_pendingInOrderScripts.takeFirst());
            postTask(BLINK_FROM_HERE);
        }

        break;
    }
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:30,代码来源:ScriptRunner.cpp

示例2: adoptPtr

blink::WebThread& HTMLParserThread::platformThread()
{
    if (!isRunning()) {
        m_thread = adoptPtr(blink::Platform::current()->createThread("HTMLParserThread"));
        postTask(WTF::bind(&HTMLParserThread::setupHTMLParserThread, this));
    }
    return *m_thread;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:HTMLParserThread.cpp

示例3: mytimer_fired

void mytimer_fired(){

 
 postTask(dataTask,3);
//add
//PhotoTempM_ExternalPhotoADC_getData();
//PhotoTempM_ExternalPhotoADC_dataReady(6);

}
开发者ID:beartan,项目名称:liteOS,代码行数:9,代码来源:Main.c

示例4: postTask

void WorkerGlobalScope::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, ScriptState* state)
{
    if (!isContextThread()) {
        postTask(AddConsoleMessageTask::create(source, level, message));
        return;
    }
    thread()->workerReportingProxy().postConsoleMessageToWorkerObject(source, level, message, lineNumber, sourceURL);
    addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, 0, state);
}
开发者ID:junmin-zhu,项目名称:blink-crosswalk,代码行数:9,代码来源:WorkerGlobalScope.cpp

示例5: postTask

void WorkerGlobalScope::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> prpConsoleMessage)
{
    RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = prpConsoleMessage;
    if (!isContextThread()) {
        postTask(AddConsoleMessageTask::create(consoleMessage->source(), consoleMessage->level(), consoleMessage->message()));
        return;
    }
    thread()->workerReportingProxy().reportConsoleMessage(consoleMessage);
    addMessageToWorkerConsole(consoleMessage.release());
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:10,代码来源:WorkerGlobalScope.cpp

示例6: postTask

void WorkerGlobalScope::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<ScriptCallStack>&& callStack, JSC::ExecState* state, unsigned long requestIdentifier)
{
    if (!isContextThread()) {
        postTask(AddConsoleMessageTask(source, level, StringCapture(message)));
        return;
    }

    thread().workerReportingProxy().postConsoleMessageToWorkerObject(source, level, message, lineNumber, columnNumber, sourceURL);
    addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, columnNumber, WTF::move(callStack), state, requestIdentifier);
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:10,代码来源:WorkerGlobalScope.cpp

示例7: postTask

void WorkerGlobalScope::addConsoleMessage(std::unique_ptr<Inspector::ConsoleMessage> message)
{
    if (!isContextThread()) {
        postTask(AddConsoleMessageTask(message->source(), message->level(), StringCapture(message->message())));
        return;
    }

    thread().workerReportingProxy().postConsoleMessageToWorkerObject(message->source(), message->level(), message->message(), message->line(), message->column(), message->url());
    addMessageToWorkerConsole(WTFMove(message));
}
开发者ID:emutavchi,项目名称:WebKitForWayland,代码行数:10,代码来源:WorkerGlobalScope.cpp

示例8: ASSERT

void HTMLParserThread::postTask(PassOwnPtr<CrossThreadClosure> closure)
{
    ASSERT(isMainThread());
    if (!m_thread) {
        m_thread = WebThreadSupportingGC::create("HTMLParserThread");
        postTask(threadSafeBind(&HTMLParserThread::setupHTMLParserThread, AllowCrossThreadAccess(this)));
    }

    m_thread->postTask(BLINK_FROM_HERE, closure);
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:10,代码来源:HTMLParserThread.cpp

示例9: postTask

void WorkerGlobalScope::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier)
{
    if (!isContextThread()) {
        postTask(AddConsoleMessageTask::create(source, level, message));
        return;
    }

    thread()->workerReportingProxy().postConsoleMessageToWorkerObject(source, level, message, 0, 0, String());
    addMessageToWorkerConsole(source, level, message, String(), 0, 0, 0, 0, requestIdentifier);
}
开发者ID:JeStasG,项目名称:phantomjs,代码行数:10,代码来源:WorkerGlobalScope.cpp

示例10: resumeActiveDOMObjects

void ExecutionContext::resumeScheduledTasks()
{
    resumeActiveDOMObjects();
    tasksWereResumed();
    // We need finish stack unwiding before running next task because it can suspend this context.
    if (m_isRunSuspendableTasksScheduled)
        return;
    m_isRunSuspendableTasksScheduled = true;
    postTask(FROM_HERE, createSameThreadTask(&ExecutionContext::runSuspendableTasks, this));
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:10,代码来源:ExecutionContext.cpp

示例11: ASSERT

void HTMLParserThread::postTask(std::unique_ptr<CrossThreadClosure> closure) {
  ASSERT(isMainThread());
  if (!m_thread) {
    m_thread = WebThreadSupportingGC::create("HTMLParserThread",
                                             BlinkGC::MainThreadHeapMode);
    postTask(crossThreadBind(&HTMLParserThread::setupHTMLParserThread,
                             crossThreadUnretained(this)));
  }

  m_thread->postTask(BLINK_FROM_HERE, std::move(closure));
}
开发者ID:mirror,项目名称:chromium,代码行数:11,代码来源:HTMLParserThread.cpp

示例12: TimerM_HandleFire

inline  
void TimerM_HandleFire(void)
{
  uint8_t i;
  uint16_t int_out;

  TimerM_setIntervalFlag = 1;


  { _atomic_t _atomic = _atomic_start();
    {
      int_out = TimerM_interval_outstanding;
      TimerM_interval_outstanding = 0;
    }
    _atomic_end(_atomic); }
  if (TimerM_mState) {
      for (i = 0; i < NUM_TIMERS; i++) {
          if (TimerM_mState & (0x1L << i)) {
              TimerM_mTimerList[i].ticksLeft -= int_out;
              if (TimerM_mTimerList[i].ticksLeft <= 2) {


                  if (postTask(TimerM_signalOneTimer, 7)) {
                      if (TimerM_mTimerList[i].type == TIMER_REPEAT) {
                          TimerM_mTimerList[i].ticksLeft += TimerM_mTimerList[i].ticks;
                        }
                      else 
                        {
                          TimerM_mState &= ~(0x1L << i);
                        }
                      TimerM_enqueue(i);
                    }
                  else {
                      {
                      }
                      ;


                      TimerM_mTimerList[i].ticksLeft = TimerM_mInterval;
                    }
                }
            }
        }
    }


  { _atomic_t _atomic = _atomic_start();
    int_out = TimerM_interval_outstanding;
    _atomic_end(_atomic); }
  if (int_out == 0) {
    TimerM_adjustInterval();
    }
}
开发者ID:beartan,项目名称:liteOS,代码行数:53,代码来源:TimerRaw.c

示例13: StandardSocketSend

//-------------------------------------------------------------------------
void StandardSocketSend(uint16_t port, uint16_t address, uint8_t msglength,
                        uint8_t * msg)
{
//    #ifdef PLATFORM_AVR_IRIS
//     sleepThread(20);
//    #endif

    radiosocketdata.socket_port = port;
    radiosocketdata.socket_addr = address;
    radiosocketdata.socket_msg_len = msglength;
    radiosocketdata.socket_msg = msg;
    postTask(send_task, 9);
    sleepThread(20);
    restoreRadioState();
    return;
}
开发者ID:beartan,项目名称:liteOS,代码行数:17,代码来源:socketradiodata.c

示例14: TimerM_Clock_fire

inline result_t TimerM_Clock_fire(void)
{
  { _atomic_t _atomic = _atomic_start();
    {

      if (TimerM_interval_outstanding == 0) {
        postTask(TimerM_HandleFire,7);
        }
      else {
        }
      ;

      TimerM_interval_outstanding += TimerM_Clock_getInterval() + 1;
    }
    _atomic_end(_atomic); }
  return SUCCESS;
}
开发者ID:beartan,项目名称:liteOS,代码行数:17,代码来源:TimerRaw.c

示例15: Standard_Receive_Packet

//Now this OS has a new packet, needs to deliver it to the correct thread for processing, and return the packet as soon as possible 
Radio_MsgPtr Standard_Receive_Packet(uint16_t port, Radio_MsgPtr packet){

	uint8_t i;

	  for (i=0;i<RECEIVE_HANDLE_NUM;i++)

      {

		if ((receivehandles[i].port  == port)&&(receivehandles[i].handlevalid == 1))
		
		{
		   uint8_t temp;
		   uint8_t j; 
		   uint8_t *buf; 
		   buf = (uint8_t*)receivehandles[i].data; 
		   
		   temp = ( packet->length > (receivehandles[i].maxLength)? (receivehandles[i].maxLength): packet->length); 
		
		   for (j=0;j<temp; j++)
		   	{
               *buf = packet->data[j];
			   buf++; 
		    }
		
		   if (receivehandles[i].packetinfo != NULL)
		   	{
              buf = (uint8_t*)receivehandles[i].packetinfo; 
			  *buf = packet->strength; 
			  buf++;
			  *buf = packet->lqi; 			  
		    }
		
		   if (receivehandles[i].handlefunc != NULL)
		   	 postTask(receivehandles[i].handlefunc, 6); 		   

           //if (*(receivehandles[i].dataReady) == 0) 
            *(receivehandles[i].dataReady) = temp;  
        
		 return packet; 
		}

    }		
   return packet; 		
}
开发者ID:beartan,项目名称:liteOS,代码行数:45,代码来源:PACKETHANDLER.C


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