コード例 #1
0
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());
}
コード例 #2
0
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));
}
コード例 #3
0
bool StorageThread::start()
{
    ASSERT(isMainThread());
    if (!m_threadID)
        m_threadID = createThread(StorageThread::threadEntryPointCallback, this, "WebCore: LocalStorage");
    activeStorageThreads().add(this);
    return m_threadID;
}
コード例 #4
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(StorageTask::createTerminate(this));
    waitForThreadCompletion(m_threadID);
    ASSERT(m_queue.killed());
    m_threadID = 0;
}
コード例 #5
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;
}