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


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

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


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

示例1: run

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

示例2: run

    void run()
    {
        pointers.setLocalData(new Pointer);

        QMutexLocker locker(&mutex);
        cond.wakeOne();
        cond.wait(&mutex);
    }
开发者ID:dewhisna,项目名称:emscripten-qt,代码行数:8,代码来源:tst_qthreadstorage.cpp

示例3: intSignalHandler

void intSignalHandler(int sig)
{
    Q_UNUSED(sig)
    hIMutex.lock();
    hasInterrupt = true;
    hICondition.wakeOne();
    hIMutex.unlock();
}
开发者ID:baz1,项目名称:TanxBot,代码行数:8,代码来源:userinterface.cpp

示例4: continueSolution

void mainWindow::continueSolution (void)
{
   pauseSolveThread = false;
   pauseButton->setEnabled(TRUE);
   continueButton->setEnabled(FALSE);
   continueSolveThread.wakeOne();
   statusLabel->setText(tr("Status: RUNNING"));
}
开发者ID:Drahm,项目名称:virtualflowlab,代码行数:8,代码来源:guiSolvePage.cpp

示例5:

void
hwcv10_proc_vsync(const struct hwc_procs* procs, int disp, int64_t timestamp)
{
    //fprintf(stderr, "%s: procs=%x, disp=%d, timestamp=%.0f\n", __func__, procs, disp, (float)timestamp);
    vsync_mutex.lock();
    vsync_cond.wakeOne();
    vsync_mutex.unlock();
}
开发者ID:JohnyZ89,项目名称:qt5-qpa-hwcomposer-plugin,代码行数:8,代码来源:hwcomposer_backend_v10.cpp

示例6: frameDoneCallback

void VS_CC frameDoneCallback(void *userData, const VSFrameRef *f, int n, VSNodeRef *, const char *errorMsg) {
    completedFrames++;

    if (f) {
        reorderMap.insert(n, f);
        while (reorderMap.contains(outputFrames)) {
            const VSFrameRef *frame = reorderMap.take(outputFrames);
            if (!outputError) {
				if (y4m) {
					if (!fwrite("FRAME\n", 6, 1, outFile)) {
						errorMessage = "Error: fwrite() call failed";
						totalFrames = requestedFrames;
						outputError = true;
					}
				}

				if (!outputError) {
					const VSFormat *fi = vsapi->getFrameFormat(frame);
					for (int p = 0; p < fi->numPlanes; p++) {
						int stride = vsapi->getStride(frame, p);
						const uint8_t *readPtr = vsapi->getReadPtr(frame, p);
						int rowSize = vsapi->getFrameWidth(frame, p) * fi->bytesPerSample;
						int height = vsapi->getFrameHeight(frame, p);
						for (int y = 0; y < height; y++) {
							if (!fwrite(readPtr, rowSize, 1, outFile)) {
								errorMessage = "Error: fwrite() call failed";
								totalFrames = requestedFrames;
								outputError = true;
								p = 100; // break out of the outer loop
								break;
							}
							readPtr += stride;
						}
					}
				}
			}
            vsapi->freeFrame(frame);
            outputFrames++;
        }
    } else {
        outputError = true;
        totalFrames = requestedFrames;
        if (errorMsg)
            errorMessage = QString("Error: Failed to retrieve frame ") + n + QString(" with error: ") + QString::fromUtf8(errorMsg);
        else
            errorMessage = QString("Error: Failed to retrieve frame ") + n;
    }

    if (requestedFrames < totalFrames) {
        vsapi->getFrameAsync(requestedFrames, node, frameDoneCallback, NULL);
        requestedFrames++;
    }

    if (totalFrames == completedFrames) {
        QMutexLocker lock(&mutex);
        condition.wakeOne();
    }
}
开发者ID:adworacz,项目名称:vapoursynth-archive,代码行数:58,代码来源:vspipe.cpp

示例7: pushDataToWrite

int RawHIDWriteThread::pushDataToWrite(const char *data, int size)
{
    QMutexLocker lock(&m_writeBufMtx);

    m_writeBuffer.append(data, size);
    m_newDataToWrite.wakeOne(); //signal that new data arrived

    return size;
}
开发者ID:Liambeguin,项目名称:TauLabs,代码行数:9,代码来源:rawhid.cpp

示例8: l

void
IdThreadWorker::stop()
{
    {
        QMutexLocker l( &s_mutex );
        m_stop = true;
    }

    s_waitCond.wakeOne();
}
开发者ID:ehaas,项目名称:tomahawk,代码行数:10,代码来源:IdThreadWorker.cpp

示例9: checkForExit

 bool checkForExit()
 {
     QMutexLocker l(&mustQuitMutex);
     if (mustQuit) {
         mustQuit = false;
         mustQuitCond.wakeOne();
         return true;
     }
     return false;
 }
开发者ID:gobomus,项目名称:Natron,代码行数:10,代码来源:FileSystemModel.cpp

示例10: abort

void UserInterface::abort()
{
    if (isRunning())
    {
        hIMutex.lock();
        isAborting = true;
        hasInterrupt = true;
        hICondition.wakeOne();
        hIMutex.unlock();
    }
}
开发者ID:baz1,项目名称:TanxBot,代码行数:11,代码来源:userinterface.cpp

示例11: put

    /**
     * @brief rajoute un vélo sur le site, si auncune borne n'est disponnible
     *        attends qu'une borne se libère
     */
    void put(){
        mutex.lock();

        while(_nbBikes >= NB_BORNES){
            availableBorne.wait(&mutex);
        }
        ++_nbBikes;
        availableBike.wakeOne();
        gui_interface->setBikes(ID, _nbBikes);

        mutex.unlock();
    }
开发者ID:AdrianoRuberto,项目名称:Labo-S4,代码行数:16,代码来源:main.cpp

示例12: checkForAbort

 bool checkForAbort()
 {
     
     QMutexLocker k(&abortRequestsMutex);
     if (abortRequests > 0) {
         abortRequests = 0;
         abortRequestsCond.wakeOne();
         return true;
     }
     return false;
     
 }
开发者ID:gobomus,项目名称:Natron,代码行数:12,代码来源:FileSystemModel.cpp

示例13: take

    /**
     * @brief enlève un vélo du site, si aucun vélo n'est disponible, attends
     *        que quelqu'un en dépose un
     */
    void take() {
        mutex.lock();

        while(_nbBikes <= 0){
            availableBike.wait(&mutex);
        }
        --_nbBikes;
        availableBorne.wakeOne();
        gui_interface->setBikes(ID, _nbBikes);

        mutex.unlock();
    }
开发者ID:AdrianoRuberto,项目名称:Labo-S4,代码行数:16,代码来源:main.cpp

示例14: run

    void run()
    {
        test_mutex.lock();

        mutex.lock();
        for (int i = 0; i < iterations; ++i) {
            cond.wakeOne();
            cond.wait(&mutex);
        }
        mutex.unlock();

        test_mutex.unlock();
    }
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:13,代码来源:tst_qmutex.cpp

示例15: 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


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