Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Closed Unassigned: http_linux : race condition in linux_connection_pool::obtain() ? [320]

$
0
0
Method checks if pool is empty ; if not, it take the first connection from pool.
However, IIUC, pool is locked in underlying methods is_pool_empty() and get_head(), so this does not work reliably (get_head() may fail, unless a higher lock ensures this can not happen)

if (is_pool_empty())
{
// No connections in pool => create a new connection instance.
return std::make_shared<linux_connection>(m_io_service);
}
else
{
// Reuse connection from pool.
auto connection(get_head());
connection->start_reuse();
return connection;
}


Viewing all articles
Browse latest Browse all 4845

Trending Articles