Waking up threads using QWaitCondition

Viewed 3018

My Qt application has a worker thread which processes new data when available. So far the worker thread used QWaitCondition to wakeup when new data is available.

However, QWaitCondition is only triggered when the thread is actively waiting via wait(). It may happen though that new data gets available while the thread is still working, or right before it runs into the next wait() command.

I am looking for something like CEvent in MFC, which "remembers" the new data notification at any time and won't wait if new data has been signaled since the last wait() call. What is the best way to achieve this in Qt?

Thanks, Fabian

2 Answers
Related