// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include // FFTW's planner - every fftwf_plan_* and fftwf_destroy_plan call - shares global state and is not // thread-safe; executing a plan is. So every piece of code that makes or destroys a plan takes this // one lock, not a lock of its own: two private locks do not stop two planners running at once. inline std::mutex &FFTWPlannerMutex() { static std::mutex m; return m; }