added mutex to udp_socket and posts the callback instead of calling it directly

This commit is contained in:
Arvid Norberg
2008-09-19 17:31:16 +00:00
parent 656ff6d5f2
commit 67f1242836
2 changed files with 45 additions and 6 deletions

View File

@@ -38,6 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <boost/function.hpp>
#include <boost/thread/mutex.hpp>
namespace libtorrent
{
@@ -83,6 +84,9 @@ namespace libtorrent
void wrap(udp::endpoint const& ep, char const* p, int len, error_code& ec);
void unwrap(error_code const& e, char const* buf, int size);
typedef boost::mutex mutex_t;
mutable mutex_t m_mutex;
udp::socket m_ipv4_sock;
udp::socket m_ipv6_sock;
udp::endpoint m_v4_ep;