From 13761504848fe31fbd762749532f7f47411b90f6 Mon Sep 17 00:00:00 2001 From: lo-simon Date: Thu, 24 Apr 2025 12:23:53 +0100 Subject: [PATCH 1/3] Add include for std::unique_lock --- Development/nmos/mutex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Development/nmos/mutex.h b/Development/nmos/mutex.h index 99ceb5acd..f455f60bb 100644 --- a/Development/nmos/mutex.h +++ b/Development/nmos/mutex.h @@ -1,6 +1,7 @@ #ifndef NMOS_MUTEX_H #define NMOS_MUTEX_H +#include #include "bst/shared_mutex.h" namespace nmos From e812ebd3b7cf140242351c591c3fc484e3062270 Mon Sep 17 00:00:00 2001 From: lo-simon Date: Thu, 24 Apr 2025 12:29:35 +0100 Subject: [PATCH 2/3] Fix for ubuntu 14.04 (C++11) --- Development/nmos/test/condition_variable_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Development/nmos/test/condition_variable_test.cpp b/Development/nmos/test/condition_variable_test.cpp index 3a2c6dac2..a524b12a6 100644 --- a/Development/nmos/test/condition_variable_test.cpp +++ b/Development/nmos/test/condition_variable_test.cpp @@ -6,7 +6,7 @@ #include "bst/test/test.h" -namespace +namespace test_condition_variable { struct test_model { @@ -89,27 +89,27 @@ namespace //////////////////////////////////////////////////////////////////////////////////////////// BST_TEST_CASE(testConditionVariableWait) { - const auto max_threads{ 500 }; + const int max_threads{ 500 }; // start a wait thread - std::thread wait_thread(wait); + std::thread wait_thread(test_condition_variable::wait); // start a large number of lock_then_unlock threads to exhaust the lock limit std::vector threads; for (auto idx = 0; idx < max_threads; idx++) { - threads.push_back(std::thread(lock_then_unlock)); + threads.push_back(std::thread(test_condition_variable::lock_then_unlock)); } // send a lot of notifications to wake up the wait thread // to wake the wait thread when lock limit is exhausted for (auto idx = 0; idx < 100; idx++) { - model.notify(); + test_condition_variable::model.notify(); } // start the thread to pause 1 second before signal a shutdown - std::thread shutdown_thread(shutdown, std::chrono::seconds{ 1 }); + std::thread shutdown_thread(test_condition_variable::shutdown, std::chrono::seconds{ 1 }); shutdown_thread.join(); wait_thread.join(); From dc8c3d500fdd1345cfe5e78ad23af2701f2cc673 Mon Sep 17 00:00:00 2001 From: lo-simon Date: Thu, 24 Apr 2025 17:09:04 +0100 Subject: [PATCH 3/3] Include for std::unique_lock --- Development/nmos/mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Development/nmos/mutex.h b/Development/nmos/mutex.h index f455f60bb..d2566f35d 100644 --- a/Development/nmos/mutex.h +++ b/Development/nmos/mutex.h @@ -1,7 +1,7 @@ #ifndef NMOS_MUTEX_H #define NMOS_MUTEX_H -#include +#include //for std::unique_lock #include "bst/shared_mutex.h" namespace nmos