本文整理汇总了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();
}
示例2: run
void run()
{
pointers.setLocalData(new Pointer);
QMutexLocker locker(&mutex);
cond.wakeOne();
cond.wait(&mutex);
}
示例3: intSignalHandler
void intSignalHandler(int sig)
{
Q_UNUSED(sig)
hIMutex.lock();
hasInterrupt = true;
hICondition.wakeOne();
hIMutex.unlock();
}
示例4: continueSolution
void mainWindow::continueSolution (void)
{
pauseSolveThread = false;
pauseButton->setEnabled(TRUE);
continueButton->setEnabled(FALSE);
continueSolveThread.wakeOne();
statusLabel->setText(tr("Status: RUNNING"));
}
示例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();
}
示例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();
}
}
示例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;
}
示例8: l
void
IdThreadWorker::stop()
{
{
QMutexLocker l( &s_mutex );
m_stop = true;
}
s_waitCond.wakeOne();
}
示例9: checkForExit
bool checkForExit()
{
QMutexLocker l(&mustQuitMutex);
if (mustQuit) {
mustQuit = false;
mustQuitCond.wakeOne();
return true;
}
return false;
}
示例10: abort
void UserInterface::abort()
{
if (isRunning())
{
hIMutex.lock();
isAborting = true;
hasInterrupt = true;
hICondition.wakeOne();
hIMutex.unlock();
}
}
示例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();
}
示例12: checkForAbort
bool checkForAbort()
{
QMutexLocker k(&abortRequestsMutex);
if (abortRequests > 0) {
abortRequests = 0;
abortRequestsCond.wakeOne();
return true;
}
return false;
}
示例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();
}
示例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();
}
示例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";
}