Skip to content

Commit

Permalink
fix(userspace/falco): adopt stricter memory order semantics
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
  • Loading branch information
jasondellaluce authored and poiana committed Sep 12, 2022
1 parent d11aec2 commit 9c184af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions userspace/falco/app_actions/process_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions userspace/falco/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion userspace/falco/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c184af

Please sign in to comment.