Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.2.0 RC2, 6.3
-
None
Description
Running a program that creates a thread and then calls start() and wait() in a loop causes the following error on Linux:
terminate called after throwing an instance of 'std::future_error' what(): std::future_error: No associated state
Here is the program:
#include <QCoreApplication> #include <QThread> #include <QTimer> static void startAndWaitForever() { QThread *thread = QThread::create([](){ }); for (;;) { thread->start(); Q_ASSERT(thread->wait()); } }; int main(int argc, char **argv) { QCoreApplication app(argc, argv); QTimer::singleShot(0, startAndWaitForever); return app.exec(); }