From e613087e97adf929b920d67cea6792898869170a Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 26 Jun 2024 12:51:13 +0200 Subject: [PATCH] another mutex test --- min_broken/main.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/min_broken/main.cpp b/min_broken/main.cpp index 843534eb..7fd48a8f 100644 --- a/min_broken/main.cpp +++ b/min_broken/main.cpp @@ -1,26 +1,8 @@ -#include #include -class TestClass { -public: - TestClass() { - std::lock_guard lck(mtx); - value = 42; - } - - int getValue() { - std::lock_guard lck(mtx); - return value; - } - -private: - std::recursive_mutex mtx; - int value = 0; -}; - -TestClass test; +std::recursive_mutex mtx; int main() { - printf("Value: %d\n", test.getValue()); + std::lock_guard lck(mtx); return 0; } \ No newline at end of file