freekill
8th January 2010, 01:14
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:
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
what could be wrong? TIA.
/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
what could be wrong? TIA.