Skip to content

Commit

Permalink
fix multithread bug occurs while accepting new connection
Browse files Browse the repository at this point in the history
  • Loading branch information
ipkn committed May 27, 2015
1 parent 4f5e36f commit 5b72a09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ namespace crow
get_cached_date_str_pool_[roundrobin_index_], *timer_queue_pool_[roundrobin_index_]
);
acceptor_.async_accept(p->socket(),
[this, p](boost::system::error_code ec)
[this, p, &is](boost::system::error_code ec)
{
if (!ec)
{
p->start();
is.post([p]
{
p->start();
});
}
do_accept();
});
Expand Down

0 comments on commit 5b72a09

Please sign in to comment.