#include #include std::recursive_mutex mtx; int main() { std::lock_guard lck(mtx); printf("Works just fine!\n"); return 0; }