It's better to lock on the connections when do shutdown,
otherwise the connections lock would be taken first by
the server main thread and wait on child connections thread
exit, but since the shutdown couldn't take the connections
lock to close the connections, this would cause a deak lock.
BTW, when a connection closed and the dealing thread exit,
remove the connection from the server's hashmap.
It's better to lock on the connections when do shutdown, otherwise the connections lock would be taken first by the server main thread and wait on child connections thread exit, but since the shutdown couldn't take the connections lock to close the connections, this would cause a deak lock.
BTW, when a connection closed and the dealing thread exit, remove the connection from the server's hashmap.
Signed-off-by: fupan.lfp fupan.lfp@antfin.com