Esempio n. 1
0
void WorkerThread::releaseFastMallocFreeMemoryInAllThreads()
{
    std::lock_guard<std::mutex> lock(threadSetMutex());

    for (auto* workerThread : workerThreads())
        workerThread->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask));
}
Esempio n. 2
0
WorkerThread::~WorkerThread()
{
    std::lock_guard<std::mutex> lock(threadSetMutex());

    ASSERT(workerThreads().contains(this));
    workerThreads().remove(this);
}
Esempio n. 3
0
void WorkerThread::releaseFastMallocFreeMemoryInAllThreads()
{
    std::lock_guard<std::mutex> lock(threadSetMutex());

    for (auto* workerThread : workerThreads())
        workerThread->runLoop().postTask([] (ScriptExecutionContext*) {
            WTF::releaseFastMallocFreeMemory();
        });
}
Esempio n. 4
0
WorkerThread::WorkerThread(const URL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin)
    : m_threadID(0)
    , m_workerLoaderProxy(workerLoaderProxy)
    , m_workerReportingProxy(workerReportingProxy)
    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin))
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    , m_notificationClient(0)
#endif
{
    std::lock_guard<std::mutex> lock(threadSetMutex());

    workerThreads().add(this);
}
Esempio n. 5
0
unsigned WorkerThread::workerThreadCount()
{
    std::lock_guard<std::mutex> lock(threadSetMutex());

    return workerThreads().size();
}