void ServiceListeners::RemoveAllListeners(ModuleContext* mc)
{
  {
    MutexLocker lock(mutex);
    for (ServiceListenerEntries::iterator it = serviceSet.begin();
         it != serviceSet.end(); )
    {

      if (it->GetModule() == mc->GetModule())
      {
        RemoveFromCache(*it);
        serviceSet.erase(it++);
      }
      else
      {
        ++it;
      }
    }
  }

  {
    MutexLocker lock(moduleListenerMapMutex);
    moduleListenerMap.erase(mc);
  }
}
Exemple #2
0
void ServiceListeners::RemoveServiceListener_unlocked(const ServiceListenerEntry& entryToRemove)
{
  ServiceListenerEntries::const_iterator it = serviceSet.find(entryToRemove);
  if (it != serviceSet.end())
  {
    it->SetRemoved(true);
    coreCtx->serviceHooks.HandleServiceListenerUnreg(*it);
    RemoveFromCache(*it);
    serviceSet.erase(it);
  }
}
void ServiceListeners::RemoveServiceListener_unlocked(const ServiceListenerEntry& entryToRemove)
{
  for (ServiceListenerEntries::iterator it = serviceSet.begin();
       it != serviceSet.end(); ++it)
  {
    if (it->operator ==(entryToRemove))
    {
      it->SetRemoved(true);
      RemoveFromCache(*it);
      serviceSet.erase(it);
      break;
    }
  }
}
Exemple #4
0
//this is the thread function which calls the subversion function
UINT CCacheDlg::TestThread()
{
	CDirFileEnum direnum(m_sRootPath);
	m_filelist.RemoveAll();
	CString filepath;
	bool bIsDir = false;
	while (direnum.NextFile(filepath, &bIsDir))
		if (filepath.Find(L".git") < 0)
			m_filelist.Add(filepath);

	CTime starttime = CTime::GetCurrentTime();
	GetDlgItem(IDC_STARTTIME)->SetWindowText(starttime.Format(L"%H:%M:%S"));

	ULONGLONG startticks = GetTickCount64();

	CString sNumber;
	std::random_device rd;
	std::mt19937 mt(rd());
	std::uniform_int_distribution<INT_PTR> dist(0, max(0, m_filelist.GetCount() - 1));
	std::uniform_int_distribution<INT_PTR> dist2(0, 9);
	for (int i=0; i < 1; ++i)
	{
		CString filepath2;
		//do {
			filepath2 = m_filelist.GetAt(dist(mt));
		//}while(filepath.Find(L".git") >= 0);
		GetDlgItem(IDC_FILEPATH)->SetWindowText(filepath2);
		GetStatusFromRemoteCache(CTGitPath(filepath2), true);
		sNumber.Format(L"%d", i);
		GetDlgItem(IDC_DONE)->SetWindowText(sNumber);
		if ((GetTickCount64()%10)==1)
			Sleep(10);
		if (dist2(mt) == 3)
			RemoveFromCache(filepath2);
	}
	CTime endtime = CTime::GetCurrentTime();
	CString sEnd = endtime.Format(L"%H:%M:%S");

	ULONGLONG endticks = GetTickCount64();

	CString sEndText;
	sEndText.Format(L"%s  - %I64u ms", (LPCTSTR)sEnd, endticks - startticks);

	GetDlgItem(IDC_ENDTIME)->SetWindowText(sEndText);

	return 0;
}
Exemple #5
0
//this is the thread function which calls the subversion function
UINT CCacheDlg::TestThread()
{
	CDirFileEnum direnum(m_sRootPath);
	m_filelist.RemoveAll();
	CString filepath;
	bool bIsDir = false;
	while (direnum.NextFile(filepath, &bIsDir))
		if(filepath.Find(_T(".git"))<0)
			m_filelist.Add(filepath);

	CTime starttime = CTime::GetCurrentTime();
	GetDlgItem(IDC_STARTTIME)->SetWindowText(starttime.Format(_T("%H:%M:%S")));
	int filecounter = 0;

	DWORD startticks = GetTickCount();

	CString sNumber;
	srand(GetTickCount());
	for (int i=0; i < 1; ++i)
	{
		CString filepath;
		//do {
			filepath = m_filelist.GetAt(rand() % m_filelist.GetCount());
		//}while(filepath.Find(_T(".git"))>=0);
		GetDlgItem(IDC_FILEPATH)->SetWindowText(filepath);
		GetStatusFromRemoteCache(CTGitPath(filepath), true);
		sNumber.Format(_T("%d"), i);
		GetDlgItem(IDC_DONE)->SetWindowText(sNumber);
		if ((GetTickCount()%10)==1)
			Sleep(10);
		if ((rand()%10)==3)
			RemoveFromCache(filepath);
	}
	CTime endtime = CTime::GetCurrentTime();
	CString sEnd = endtime.Format(_T("%H:%M:%S"));

	DWORD endticks = GetTickCount();

	CString sEndText;
	sEndText.Format(_T("%s  - %d ms"), sEnd, endticks-startticks);

	GetDlgItem(IDC_ENDTIME)->SetWindowText(sEndText);

	return 0;
}
Exemple #6
0
void Definition::AddTail(Node* pNode)
{
//		if(Reference* pRef = dynamic_cast<Reference*>(pNode))
    {
        ASSERT(m_status == node);

        m_status = node;

        if(IsTypeUnknown() && !pNode->IsTypeUnknown())
        {
            m_type = pNode->m_type;
            m_autotype = true;
        }

        RemoveFromCache(pNode->m_type);
    }

    __super::AddTail(pNode);
}
Exemple #7
0
void imgRequest::Cancel(nsresult aStatus)
{
  /* The Cancel() method here should only be called by this class. */

  LOG_SCOPE(gImgLog, "imgRequest::Cancel");

  if (mImage) {
    LOG_MSG(gImgLog, "imgRequest::Cancel", "stopping animation");

    mImage->StopAnimation();
  }

  if (!(mImageStatus & imgIRequest::STATUS_LOAD_PARTIAL))
    mImageStatus |= imgIRequest::STATUS_ERROR;

  RemoveFromCache();

  if (mRequest && mLoading)
    mRequest->Cancel(aStatus);
}
 // This gets called when the timeout has expired on a gfxTextRun
 virtual void NotifyExpired(gfxTextRun* aTextRun) {
   RemoveFromCache(aTextRun);
   delete aTextRun;
 }
Exemple #9
0
Definition::~Definition()
{
    RemoveFromCache();
}