adjust listen locking, fixes #66

This commit is contained in:
Peter Thorson
2012-02-13 07:06:15 -06:00
parent 84884ff9cd
commit e94825bb41

View File

@@ -230,7 +230,7 @@ private:
template <class endpoint>
void server<endpoint>::listen(const boost::asio::ip::tcp::endpoint& e) {
boost::lock_guard<boost::recursive_mutex> lock(m_endpoint.get_lock());
boost::unique_lock<boost::recursive_mutex> lock(m_endpoint.get_lock());
if (m_state != IDLE) {
throw exception("listen called from invalid state.");
@@ -242,6 +242,8 @@ void server<endpoint>::listen(const boost::asio::ip::tcp::endpoint& e) {
m_acceptor.listen();
this->start_accept();
lock.unlock();
m_endpoint.run_internal();
}