#pragma once #include <string> void thread_safe_function(std::string str);
#include "thread_safe_function.hpp" #include <string> #include <iostream> #include <mutex> std::mutex mtx; void thread_safe_function(std::string str) { std::lock_guard<std::mutex> lck(mtx); std::cout << str << std::endl; }