void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() { std::lock_guard<std::mutex> lock(threadSetMutex()); for (auto* workerThread : workerThreads()) workerThread->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask)); }
WorkerThread::~WorkerThread() { std::lock_guard<std::mutex> lock(threadSetMutex()); ASSERT(workerThreads().contains(this)); workerThreads().remove(this); }
void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() { std::lock_guard<std::mutex> lock(threadSetMutex()); for (auto* workerThread : workerThreads()) workerThread->runLoop().postTask([] (ScriptExecutionContext*) { WTF::releaseFastMallocFreeMemory(); }); }
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); }
unsigned WorkerThread::workerThreadCount() { std::lock_guard<std::mutex> lock(threadSetMutex()); return workerThreads().size(); }