mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-07 10:42:31 +00:00
Properly use compare_exchange_strong
In practice, calling `network.scgi.open_port` again doesn't trigger this function.
This commit is contained in:
@@ -67,11 +67,10 @@ ThreadWorker::init_thread() {
|
||||
|
||||
bool
|
||||
ThreadWorker::set_scgi(rpc::SCgi* scgi) {
|
||||
if (m_scgi != nullptr)
|
||||
rpc::SCgi* expected = nullptr;
|
||||
if (!m_scgi.compare_exchange_strong(expected, scgi))
|
||||
return false;
|
||||
|
||||
m_scgi = scgi;
|
||||
|
||||
change_xmlrpc_log();
|
||||
|
||||
queue_item((thread_base_func)&start_scgi);
|
||||
|
||||
Reference in New Issue
Block a user