本文整理汇总了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;
}
}
示例2: stop
void stop()
{
m_bQuitRequest=true;
m_pDataReady->wakeAll();
wait();
m_bQuitRequest=false;
};
示例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;
}
示例4: PostLoad
static void PostLoad(const QString &cacheKey)
{
m_loadingImagesLock.lock();
m_loadingImages.remove(cacheKey);
m_loadingImagesCond.wakeAll();
m_loadingImagesLock.unlock();
}
示例5: WakeUpThread
void QtMediaPlayerJNI::WakeUpThread()
{
while(mutexload==NULL);
mutexload->lock();
waitCondition.wakeAll();
mutexload->unlock();
mutexload = NULL;
}
示例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();
}
示例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();
}
示例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
}
示例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();
}
示例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();
}
示例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";
}
示例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();
}
示例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();
}
}
示例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");
}
示例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();
}