示例#1
0
windows_process::~windows_process()
{
	ProcessPool *pp = ProcPool();
	GeneratorWindows* winGen = static_cast<GeneratorWindows*>(GeneratorWindows::getDefaultGenerator());
	pp->condvar()->lock();
	winGen->removeProcess(this);
	pp->condvar()->unlock();
	// Do NOT close the process handle; that's handled by ContinueDebugEvent. Closing the file is okay.
	::CloseHandle(hfile);
	
}
示例#2
0
bool GeneratorMT::processWait(bool block)
{
   ProcessPool *pp = ProcPool();
   pp->condvar()->lock();
   pthrd_printf("Checking for live processes\n");
   while (!hasLiveProc() && !isExitingState()) {
      pthrd_printf("Checked and found no live processes\n");
      if (!block) {
         pthrd_printf("Returning from non-blocking processWait\n");
         pp->condvar()->broadcast();
         pp->condvar()->unlock();
         return false;
      }
      pp->condvar()->wait();
   }
   pp->condvar()->broadcast();
   pp->condvar()->unlock();
   pthrd_printf("processWait returning true\n");
   return true;
}