diff --git a/Development/nmos/mutex.h b/Development/nmos/mutex.h index 99ceb5acd..d2566f35d 100644 --- a/Development/nmos/mutex.h +++ b/Development/nmos/mutex.h @@ -1,6 +1,7 @@ #ifndef NMOS_MUTEX_H #define NMOS_MUTEX_H +#include //for std::unique_lock #include "bst/shared_mutex.h" namespace nmos 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();