Skip to content

Commit

Permalink
Properly use compare_exchange_strong
Browse files Browse the repository at this point in the history
In practice, calling `network.scgi.open_port` again doesn't trigger
this function.
  • Loading branch information
kannibalox authored and rakshasa committed Jan 18, 2025
1 parent 96cef4b commit 3414298
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/thread_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3414298

Please sign in to comment.