当前位置: 首页>>代码示例>>C++>>正文


C++ QWaitCondition::wakeAll方法代码示例

本文整理汇总了C++中QWaitCondition::wakeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ QWaitCondition::wakeAll方法的具体用法?C++ QWaitCondition::wakeAll怎么用?C++ QWaitCondition::wakeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QWaitCondition的用法示例。


在下文中一共展示了QWaitCondition::wakeAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: requestStop

void ThreadServerPool::requestStop(void)
{
    QMutexLocker locker(&this->_mutex);
    this->_stopRequested = true;

    // Request stop for all threads client
    foreach (ThreadClient* threadClient, this->_threadsClient)
        threadClient->requestStop();

    // Wake all threads client which could be blocked on QWaitCondition
    clientsIsNotEmpty.wakeAll();

    // Wait until all threads client stop
    foreach (ThreadClient* threadClient, this->_threadsClient)
            threadClient->wait();

    // Free client sockets
    conditionMutex.lock();
    clients.clear();
    conditionMutex.unlock();

    // Interrupt server blocking function
    if (this->_socketServer != NULL && this->_socketServer->isValid())
    {
        delete this->_socketServer; // Shutdown and close
        this->_socketServer = NULL;
    }
}
开发者ID:xaviermawet,项目名称:M18-OS,代码行数:28,代码来源:ThreadServerPool.cpp

示例2: stop

 void stop()
 {
     m_bQuitRequest=true;
     m_pDataReady->wakeAll();
     wait();
     m_bQuitRequest=false;
 };
开发者ID:app,项目名称:tradeequip,代码行数:7,代码来源:tedisplaybase.cpp

示例3: k

GenericSchedulerThread::ThreadStateEnum
GenericSchedulerThreadPrivate::resolveState()
{
    GenericSchedulerThread::ThreadStateEnum ret = GenericSchedulerThread::eThreadStateActive;

    // flag that we have quit the thread
    {
        QMutexLocker k(&mustQuitMutex);
        if (mustQuit) {
            mustQuit = false;
            startingThreadAllowed = lastQuitThreadAllowedRestart;
            ret = GenericSchedulerThread::eThreadStateStopped;
            // Wake up threads waiting in waitForThreadToQuit
            mustQuitCond.wakeAll();
        }
    }

    {
        QMutexLocker k(&abortRequestedMutex);
        if (abortRequested > 0) {
            if (ret == GenericSchedulerThread::eThreadStateActive) {
                ret = GenericSchedulerThread::eThreadStateAborted;
            }
        }
    }


    return ret;
}
开发者ID:cf-ssharma,项目名称:Natron,代码行数:29,代码来源:GenericSchedulerThread.cpp

示例4: PostLoad

 static void PostLoad(const QString &cacheKey)
 {
     m_loadingImagesLock.lock();
     m_loadingImages.remove(cacheKey);
     m_loadingImagesCond.wakeAll();
     m_loadingImagesLock.unlock();
 }
开发者ID:tgm4883,项目名称:lr-rpi2,代码行数:7,代码来源:mythuiimage.cpp

示例5: WakeUpThread

void QtMediaPlayerJNI::WakeUpThread()
{
    while(mutexload==NULL);
    mutexload->lock();
    waitCondition.wakeAll();
    mutexload->unlock();
    mutexload = NULL;
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:8,代码来源:mediaPlayerJNI.cpp

示例6: gotSound

void SndThr::gotSound(unsigned id)
{
    (void)id;
    mut2.lock();
    sndDone = true;
    mut2.unlock();
    //Debug() << "EmulApp manual trigger thread will be woken up for trigger " << trig;
    cond2.wakeAll();
}
开发者ID:jerlich,项目名称:rt-fsm,代码行数:9,代码来源:EmulApp.cpp

示例7: triggered

void SndThr::triggered(int trig)
{
    (void)trig;
    mut.lock();
    trigDone = true;
    mut.unlock();
    //Debug() << "EmulApp manual trigger thread will be woken up for trigger " << trig;
    cond.wakeAll();
}
开发者ID:jerlich,项目名称:rt-fsm,代码行数:9,代码来源:EmulApp.cpp

示例8: sync

// Wake from executive wait condition (RT-safe).
void qmidinetJackMidiThread::sync (void)
{
	if (m_mutex.tryLock()) {
		m_cond.wakeAll();
		m_mutex.unlock();
	}
#ifdef CONFIG_DEBUG
	else qDebug("qmidinetJackMidiThread[%p]::sync(): tryLock() failed.", this);
#endif
}
开发者ID:rncbc,项目名称:qmidinet,代码行数:11,代码来源:qmidinetJackMidiDevice.cpp

示例9: receivedMessage

/// \brief  Handles messages received from logging clients
/// \param  msg    The message received (can be multi-part)
void LogServerThread::receivedMessage(const QList<QByteArray> &msg)
{
    LogMessage *message = new LogMessage(msg);
    QMutexLocker lock(&logMsgListMutex);

    bool wasEmpty = logMsgList.isEmpty();
    logMsgList.append(message);

    if (wasEmpty)
        logMsgListNotEmpty.wakeAll();
}
开发者ID:bas-t,项目名称:mythtv,代码行数:13,代码来源:loggingserver.cpp

示例10: run

 void run()
 {
     readWriteLock->lockForWrite();
     ++count;
     dummy.wakeOne(); // this wakeup should be lost
     started.wakeOne();
     dummy.wakeAll(); // this one too
     cond->wait(readWriteLock);
     --count;
     readWriteLock->unlock();
 }
开发者ID:KDE,项目名称:android-qt5-qtbase,代码行数:11,代码来源:tst_qwaitcondition.cpp

示例11: qDebug

void Consumer1::run()
{
    qDebug() << "Consumer " << m_id << " before wakeall ";

    if(m_bWakeAll)
        g_con.wakeAll();
    else
        g_con.wakeOne();

    qDebug() << "Consumer " << m_id << " after wakeall";


}
开发者ID:kfengbest,项目名称:QtThreads,代码行数:13,代码来源:worker1.cpp

示例12: run

    void run()
    {
        _qCoreApplication.reset(new QCoreApplication(_dummyArgc, const_cast<char**>(&_dummyArgs[0])));
        OsmAnd::initializeInAppThread();
        {
            QMutexLocker scopedLocker(&_qCoreApplicationThreadMutex);

            wasInitialized = true;

            _qCoreApplicationThreadWaitCondition.wakeAll();
        }
        QCoreApplication::exec();
        OsmAnd::releaseInAppThread();
        _qCoreApplication.reset();
    }
开发者ID:SfietKonstantin,项目名称:OsmAnd-core,代码行数:15,代码来源:OsmAndCore.cpp

示例13: run

void Producer::run()
{
    for (int i = 0; i < DataSize; ++i) {
        mutex.lock();

        if (numUsedBytes == BufferSize) {
            bufferEmpty.wait(&mutex);
        }
        buffer[i % BufferSize] = numUsedBytes;
        ++numUsedBytes;
        bufferFull.wakeAll();

        mutex.unlock();
    }
}
开发者ID:TraumLou,项目名称:qt,代码行数:15,代码来源:main.cpp

示例14: run

void Consumer::run()
{
    for (int i = 0; i < DataSize; ++i) {
        mutex.lock();
        if (numUsedBytes == 0)
            bufferNotEmpty.wait(&mutex);
        mutex.unlock();

        fprintf(stderr, "%c", buffer[i % BufferSize]);

        mutex.lock();
        --numUsedBytes;
        bufferNotFull.wakeAll();
        mutex.unlock();
    }
    fprintf(stderr, "\n");
}
开发者ID:Andreas665,项目名称:qt,代码行数:17,代码来源:waitconditions.cpp

示例15: load

void GfxImageLoaderEngine::load(GfxImageLoader *out, const QString &filename, 
                                const QList<QSize> &sizes)
{
    lock.lock();

    bool wasEmpty = ops.isEmpty();
    Op op;
    op.filename = filename;
    op.sizes = sizes;
    op.id = id++;
    op.out = out;
    ops.insert(out, op);

    if(wasEmpty)
        wait.wakeAll();
    lock.unlock();
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:17,代码来源:gfximageloader.cpp


注:本文中的QWaitCondition::wakeAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。