void PeriodicTask::setStrand(qi::Strand* strand) { if (strand) _p->_scheduleCallback = boost::bind( &qi::Strand::asyncDelay<const Callback&>, strand, _1, _2); else _p->_scheduleCallback = ScheduleCallback(); }
void HXOverlayManager::ValidateCurrentOwner() { IHXOverlayResponse* pMaxResp = NULL; UINT32 ulMaxNumPixelsPerSecond = 0; UINT32 ulCurrentNumPixelsPerSecond = 0; CSiteStats* pStats = NULL; CHXSimpleList::Iterator i; for (i = m_ListOfSiteStats.Begin(); i != m_ListOfSiteStats.End(); ++i) { pStats = (CSiteStats*)*i; if (pStats->pResp == m_pCurrentOverlayOwner) { ulCurrentNumPixelsPerSecond = pStats->ulNumPixelsPerSecond; } if (ulMaxNumPixelsPerSecond < pStats->ulNumPixelsPerSecond) { ulMaxNumPixelsPerSecond = pStats->ulNumPixelsPerSecond; pMaxResp = pStats->pResp; } } #ifdef _DEBUG_LOG FILE* f = fopen("c:\\overlay.txt", "a+"); fprintf(f, "CurrentOvOwner = %p Pels: %d \t\t\t Max: %p Pels: %d\n", m_pCurrentOverlayOwner, ulCurrentNumPixelsPerSecond, pMaxResp, ulMaxNumPixelsPerSecond); fclose(f); #endif if ((double)ulMaxNumPixelsPerSecond > (double)ulCurrentNumPixelsPerSecond * 2) { #ifdef _DEBUG_LOG UINT32 ulTempMaxNumPixelsPerSecond = 0; FILE* f = fopen("c:\\overlay.txt", "a+"); if (f) { CHXSimpleList::Iterator i; for (i = m_ListOfSiteStats.Begin(); i != m_ListOfSiteStats.End(); ++i) { pStats = (CSiteStats*)*i; fprintf(f, "Owner: %p Pixels: %d NumSamples: %d \n", pStats->pResp , pStats->ulNumPixelsPerSecond, pStats->samples.GetCount()); if (pStats->pResp == m_pCurrentOverlayOwner) { fprintf(f, "** Current Owner: %p Current Num: %d\n", pStats->pResp , pStats->ulNumPixelsPerSecond); } if (ulTempMaxNumPixelsPerSecond < pStats->ulNumPixelsPerSecond) { fprintf(f, "** Current Max Owner: %p Current Num: %d\n", pStats->pResp , pStats->ulNumPixelsPerSecond); ulTempMaxNumPixelsPerSecond = pStats->ulNumPixelsPerSecond; } } fclose(f); } #endif ScheduleCallback(m_pCurrentOverlayOwner, pMaxResp); } }
STDMETHODIMP HXClientPropWatch::PropWatchResponse::DeletedProp(const UINT32 id, const UINT32 ulParentID) { /* If we are at interrupt time, make sure that the * response is interrupt safe */ if (m_pPropWatch->m_pInterruptState && m_pPropWatch->m_pInterruptState->AtInterruptTime() && (!m_pPropWatch->m_pInterruptSafeResponse || !m_pPropWatch->m_pInterruptSafeResponse->IsInterruptSafe())) { ScheduleCallback(DELETEDPROP, id, (HXPropType) 0, ulParentID); } else { ProcessPendingResponses(); m_pPropWatch->m_pResponse->DeletedProp(id, ulParentID); } return HXR_OK; }