I settled for QWaitCondition with the idea of having my image buffer alert sleeping threads via waitCondition.wakeAll() and have the run() functions of the rendering and computing threads sleep when done with its current processing via waitCondition.wait(). I kept pointers to the waitCondition to allow the various threads access to it. However, I'm having this compile-time error in my computing thread: no matching function for call to 'QWaitCondition::wait()'.
//window.h
Private:
ComputeThread* computeThread;
//window.cpp
Window::Window()
{
pWaitCondition = waitCondition;
computeThread = new ComputeThread(pWaitCondition);
}
//computethread.h
Private:
//computethread.cpp
{
newImage = wc;
}
void ComputeThread::run()
{
newImage->wait(); //error goes here
}
//window.h
Private:
QWaitCondition waitCondtion;
QWaitCondition* pWaitCondition;
ComputeThread* computeThread;
//window.cpp
Window::Window()
{
pWaitCondition = waitCondition;
computeThread = new ComputeThread(pWaitCondition);
}
//computethread.h
Private:
QWaitCondition* newImage;
//computethread.cpp
ComputeThread::ComputeThread(QWaitCondition* wc)
{
newImage = wc;
}
void ComputeThread::run()
{
newImage->wait(); //error goes here
}
To copy to clipboard, switch view to plain text mode
Bookmarks