fix(userspace/falco): adopt stricter memory order semantics

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce
2022-09-01 14:08:17 +00:00
committed by poiana
parent d11aec28d5
commit 9c184af2a1
3 changed files with 5 additions and 5 deletions

View File

@@ -97,8 +97,8 @@ application::run_result application::do_inspect(
{
rc = inspector->next(&ev);
if(m_state->terminate.load(std::memory_order_acquire)
|| m_state->restart.load(std::memory_order_acquire))
if(m_state->terminate.load(std::memory_order_seq_cst)
|| m_state->restart.load(std::memory_order_seq_cst))
{
break;
}

View File

@@ -69,7 +69,7 @@ void application::terminate()
{
if(m_state != nullptr)
{
m_state->terminate.store(true, std::memory_order_release);
m_state->terminate.store(true, std::memory_order_seq_cst);
}
}
@@ -87,7 +87,7 @@ void application::restart()
{
if(m_state != nullptr)
{
m_state->restart.store(true, std::memory_order_release);
m_state->restart.store(true, std::memory_order_seq_cst);
}
}

View File

@@ -66,7 +66,7 @@ void falco_webserver::start(
}
std::atomic<bool> failed;
failed.store(false, std::memory_order_relaxed);
failed.store(false, std::memory_order_release);
m_server_thread = std::thread([this, listen_port, &failed]
{
try