10#include "mcrl2/atermpp/detail/gc_stress_thread.h"
12#include "mcrl2/atermpp/detail/aterm_configuration.h"
13#include "mcrl2/atermpp/detail/thread_aterm_pool.h"
33 if constexpr (EnableGCStressThread && mcrl2::utilities::detail::GlobalThreadSafe)
35 g_gc_stress_running.store(
true, std::memory_order_relaxed);
39 while (g_gc_stress_running.load(std::memory_order_relaxed))
41 g_thread_term_pool().collect();
42 std::this_thread::sleep_for(std::chrono::milliseconds(1));
45 std::atexit(stop_gc_stress_thread);
53 g_gc_stress_running.store(
false, std::memory_order_relaxed);
A unordered_map class in which aterms can be stored.
std::thread g_gc_stress_thread
std::atomic< bool > g_gc_stress_running
void stop_gc_stress_thread()
Stop the background GC stress thread if it is running.
void start_gc_stress_thread()
Spawns a dedicated background thread that continuously triggers garbage collection.
The main namespace for the aterm++ library.