Properly use compare_exchange_strong

In practice, calling `network.scgi.open_port` again doesn't trigger
this function.
This commit is contained in:
kannibalox
2024-12-03 12:26:51 -05:00
committed by Jari Sundell
parent 93b3a34f28
commit 4e64fbc78b
+2 -3
View File
@@ -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);