mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
fix multithread bug occurs while accepting new connection
This commit is contained in:
parent
4f5e36f927
commit
5b72a09973
@ -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();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user