在asio::io_服务中,我插入对象。asio::io_service::run()在多个线程中运行。
期望队列中任何对象完成的可能性是必要的。
例如:
template <typename T>
struct handler {
void operator()() {
....
}
T get() const {...}
};
asio::io_service ios;
ios.post(handler());
-
如何引用队列中的对象?
-
在执行句柄::operator()之前,如何暂停主程序循环?
谢谢。