What is the best way to wait on multiple condition variables in C++11?
问题 First a little context : I'm in the process of learning about threading in C++11 and for this purpose, I'm trying to build a small actor class, essentially (I left the exception handling and propagation stuff out) like so: class actor { private: std::atomic<bool> stop; private: std::condition_variable interrupt; private: std::thread actor_thread; private: message_queue incoming_msgs; public: actor() : stop(false), actor_thread([&]{ run_actor(); }) {} public: virtual ~actor() { // if the actor