diff options
Diffstat (limited to 'src/syncServer.cpp')
-rw-r--r-- | src/syncServer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/syncServer.cpp b/src/syncServer.cpp index 1468d74..b2e4cf8 100644 --- a/src/syncServer.cpp +++ b/src/syncServer.cpp @@ -10,6 +10,7 @@ SyncServer::SyncServer(asio::io_service& io_service, asio::ip::tcp::endpoint tcp void SyncServer::start_accept() { + Lock lock(mutex_); SyncTcpConnection::pointer new_connection = SyncTcpConnection::create(acceptor_.io_service()); conns_.push_back(new_connection); @@ -21,6 +22,7 @@ void SyncServer::start_accept() void SyncServer::send(std::string message) { + Lock lock(mutex_); for(std::list<SyncTcpConnection::pointer>::iterator it = conns_.begin() ;it != conns_.end(); ++it) { (*it)->Send(message); } |