void StorageThread::releaseFastMallocFreeMemoryInAllThreads() { HashSet<StorageThread*>& threads = activeStorageThreads(); HashSet<StorageThread*>::iterator end = threads.end(); for (HashSet<StorageThread*>::iterator it = threads.begin(); it != end; ++it) (*it)->scheduleTask(StorageTask::createReleaseFastMallocFreeMemory()); }
void StorageThread::releaseFastMallocFreeMemoryInAllThreads() { HashSet<StorageThread*>& threads = activeStorageThreads(); for (HashSet<StorageThread*>::iterator it = threads.begin(), end = threads.end(); it != end; ++it) (*it)->dispatch(bind(WTF::releaseFastMallocFreeMemory)); }
bool StorageThread::start() { ASSERT(isMainThread()); if (!m_threadID) m_threadID = createThread(StorageThread::threadEntryPointCallback, this, "WebCore: LocalStorage"); activeStorageThreads().add(this); return m_threadID; }
void StorageThread::terminate() { ASSERT(isMainThread()); ASSERT(!m_queue.killed() && m_threadID); activeStorageThreads().remove(this); // Even in weird, exceptional cases, don't wait on a nonexistent thread to terminate. if (!m_threadID) return; m_queue.append(StorageTask::createTerminate(this)); waitForThreadCompletion(m_threadID); ASSERT(m_queue.killed()); m_threadID = 0; }
void StorageThread::terminate() { ASSERT(isMainThread()); ASSERT(!m_queue.killed() && m_threadID); activeStorageThreads().remove(this); // Even in weird, exceptional cases, don't wait on a nonexistent thread to terminate. if (!m_threadID) return; m_queue.append(std::make_unique<Function<void ()>>(bind(&StorageThread::performTerminate, this))); waitForThreadCompletion(m_threadID); ASSERT(m_queue.killed()); m_threadID = 0; }