#include #include #include std::recursive_mutex global_lock; int no_lock() { return 2; } int take_lock() { std::unique_lock lock(global_lock); return 2; } TEST_CASE("std::recursive_mutex overhead benchmark", "[benchmark][mutex]") { BENCHMARK("no lock") { return no_lock(); }; BENCHMARK("with std::recursive_mutex") { return take_lock(); }; }