Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

io_service::strand::post

Request the strand to invoke the given handler and return immediately.

template<
    typename Handler>
void post(
    Handler handler);

This function is used to ask the strand to execute the given handler, but without allowing the strand to call the handler from inside this function.

The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The strand's guarantee is in addition to the guarantee provided by the underlying io_service. The io_service guarantees that the handler will only be called in a thread in which the io_service's run member function is currently being invoked.

Parameters

handler

The handler to be called. The strand will make a copy of the handler object as required. The function signature of the handler must be:

void handler(); 


PrevUpHomeNext