std::string fullConfig;std::condition_variable waiter;auto configHandler = [&waiter](const std::string& configStr, bool){ fullConfig = configStr; waiter.notify_all();};boost::asio::io_context ctx;ConfigReaderWorker worker(ctx, settings, configHandler);std::thread configThread = std::thread(std::bind([&ctx](){ctx.run();}));std::mutex locker;std::unique_lock lock(locker);waiter.wait_for(lock, []{return !fullConfig.empty();});worker.stop();ctx.stop();
void MainThreadWorker::onFinishShadowThread(){ emit workShadowThread(/* work params */)}
C++ (Qt)// main threadfor (...) { ... if (..) emit SignalDoSomething(options); // QThreadPool::addTask(options) ..}waitForDone();
std::string fullConfig;std::condition_variable waiter;auto configHandler = [&waiter](const std::string& configStr, bool)