Clone
ixen <ixen@copyhandler.com>
committed
on 19 Oct 16
Decoupled overlapped data buffer from buffer queue (CH-270).
ParallelizeReaderWriter + 4 more
src/libchengine/TTask.cpp (+3 -1)
533 533         }
534 534
535 535         DWORD WINAPI TTask::DelegateThreadProc(LPVOID pParam)
536 536         {
537 537                 BOOST_ASSERT(pParam);
538 538                 if (!pParam)
539 539                         return 1;
540 540
541 541                 TTask* pTask = (TTask*)pParam;
542 542                 return pTask->ThrdProc();
543 543         }
544 544
545 545         DWORD TTask::ThrdProc()
546 546         {
547 547                 // start tracking time for this thread
548 548                 TScopedRunningTimeTracker tProcessingGuard(m_tLocalStats);
549 549
550 550                 // set time tracker and ensure it is unset on scope exit
551 551                 m_spFeedbackManager->SetTimeTracker(&tProcessingGuard);
552 552
  553 #pragma warning(push)
  554 #pragma warning(disable: 4459)
553 555                 BOOST_SCOPE_EXIT(&m_spFeedbackManager) {
554 556                         m_spFeedbackManager->SetTimeTracker(nullptr);
555 557                 } BOOST_SCOPE_EXIT_END
556  
  558 #pragma warning(pop)
557 559                 const size_t ExceptionBufferSize = 2048;
558 560                 std::unique_ptr<wchar_t[]> upExceptionInfoBuffer(new wchar_t[ExceptionBufferSize]);
559 561                 try
560 562                 {
561 563                         // start operation
562 564                         OnBeginOperation();
563 565
564 566                         // enable configuration changes tracking
565 567                         m_tConfiguration.ConnectToNotifier(TTaskConfigTracker::NotificationProc, &m_cfgTracker);
566 568                         m_tConfiguration.ConnectToNotifier(TTask::OnCfgOptionChanged, this);
567 569
568 570                         // verify configuration is valid
569 571                         TTaskConfigVerifier::VerifyAndUpdate(m_tConfiguration, m_spLog);
570 572
571 573                         // set thread options
572 574                         HANDLE hThread = GetCurrentThread();
573 575                         ::SetThreadPriorityBoost(hThread, GetTaskPropValue<eTO_DisablePriorityBoost>(m_tConfiguration));
574 576
575 577                         // initialize subtask array
576 578                         m_tSubTasksArray.InitBeforeExec();