Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2007-05-25 09:58:24

On Tue, 22 May 2007 20:30:01 +0530, Gaurav.Jain_at_[hidden] said:
> Yes scheduler is an io_service. I am now not using scheduler.stop() in
> my code & doing what have you suggested in your reply. But still
> server is not getting cleanly shutdown as per my design. Here is what
> am I doing :

You are posting the io_object::stop_all() call into the io_service here:

> io_object_temp->get_ioservice().post(boost::bind(&io_object::stop_all,
> io_object_temp));

and then inside io_object::stop_all() you attempt to join() the thread
that is calling io_service::run():

> execution_thread->join();

Since the io_service executes posted handlers inside io_service::run(),
this may mean you are trying to join the thread from within the thread
itself. I suggest moving the join() call to io_object_pool::stop_all()
so that it is performed outside of the io_service::run() thread.


Boost list run by bdawes at, gregod at, cpdaniel at, john at