mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-08 15:19:20 +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
|
bool
|
||||||
ThreadWorker::set_scgi(rpc::SCgi* scgi) {
|
ThreadWorker::set_scgi(rpc::SCgi* scgi) {
|
||||||
if (m_scgi != nullptr)
|
rpc::SCgi* expected = nullptr;
|
||||||
|
if (!m_scgi.compare_exchange_strong(expected, scgi))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_scgi = scgi;
|
|
||||||
|
|
||||||
change_xmlrpc_log();
|
change_xmlrpc_log();
|
||||||
|
|
||||||
queue_item((thread_base_func)&start_scgi);
|
queue_item((thread_base_func)&start_scgi);
|
||||||
|
|||||||
Reference in New Issue
Block a user