Vadim Guchenko wrote:
Hello, All!
I want to do something like this:
Wrapper wrapper(final_handler); w_handler1 = wrapper.wrap(handler1); ... w_handlerN = wrapper.wrap(handlerN);
where the final_handler() must be invoked as soon as all the wrapped handlers handler1() ... handlerN() are invoked through w_handler1() ... w_handlerN() in any order. Is there any existing Boost tool for that?
It is not 100% clear to me what you want, but I'd say you could use promise/future from Boost Thread: http://www.boost.org/doc/libs/1_41_0/doc/html/thread/synchronization.html#th... You would have promise1..N which are set by handler/wrapper1..N. The final wrapper would have to wait for the synchronous future values 1..N and could proceed afterwards. HTH Roland