zaphoyd/websocketpp — Issue #66: Policy Refactor: Unneccesary lock in server.
Author: megabyte1024
Created: 2012-02-13 10:56:21+00:00
State: open

With new locks there is a almost infinite lock if to call the endpoint's stop method. The logic is simple. In one thread the server's listen method is called and it locks the endpoint's mutex. If a parallel thread calls the endpoint's stop method, then it starts to wait till the listen releases the mutex and it will happen only if a connection closed.

Fix: to eliminate the following line from the server's listen method

boost::lock_guard lock(m_endpoint.get_lock());