void ChildProcess::terminationTimerFired()
{
    if (!shouldTerminate())
        return;

    terminate();
}
Beispiel #2
0
void WebContext::enableProcessTermination()
{
    m_processTerminationEnabled = true;
    Vector<RefPtr<WebProcessProxy>> processes = m_processes;
    for (size_t i = 0; i < processes.size(); ++i) {
        if (shouldTerminate(processes[i].get()))
            processes[i]->terminate();
    }
}
Beispiel #3
0
void PluginProcess::initializeProcess(const ChildProcessInitializationParameters& parameters)
{
    m_pluginPath = parameters.extraInitializationData.get("plugin-path");
    platformInitializeProcess(parameters);

    auto& memoryPressureHandler = MemoryPressureHandler::singleton();
    memoryPressureHandler.setLowMemoryHandler([this] (Critical, Synchronous) {
        if (shouldTerminate())
            terminate();
    });
    memoryPressureHandler.install();
}
Beispiel #4
0
bool RTAudioDriverThread::Execute() {

	int bufferSize=Audio::GetInstance()->GetAudioBufferSize() ;
	float cycleTime=bufferSize/44100.0f ;
	TimeService *ts=TimeService::GetInstance();
	while (!shouldTerminate()) {
		semaphore_->Wait() ;
		float before=float(ts->GetTime()) ;
		driver_->OnNewBufferNeeded() ;
		float delta=float(ts->GetTime()-before) ; // in secs
		percentage_=int(delta/cycleTime*100);
	} ;
	delete semaphore_ ;
	return true ;
} ;