Boost logo

Boost Users :

Subject: Re: [Boost-users] asio: async ops in multithreading environment
From: Igor R (boost.lists_at_[hidden])
Date: 2013-03-06 06:21:36


> The problem is: second write which is issued internally by boost
> cannot be protected by the same mutex which is used for protected
> access to the socket in my code.
>
> So, the question is: how can I safely close the socket?

You should use strands:
http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/overview/core/strands.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net