]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1089] reverted changes
authorRazvan Becheriu <razvan@isc.org>
Wed, 1 Apr 2020 15:26:37 +0000 (18:26 +0300)
committerFrancis Dupont <fdupont@isc.org>
Thu, 2 Apr 2020 09:27:57 +0000 (09:27 +0000)
src/lib/util/tests/thread_pool_unittest.cc

index e10a5871c693217662b5609dcb250a6c5436c676..5658910421ee245552e5f609a2a0697b378e256e 100644 (file)
@@ -60,13 +60,9 @@ public:
     /// @brief task function which tries to stop the thread pool and then calls
     /// @ref runAndWait
     void runStopResetAndWait(ThreadPool<CallBack>* thread_pool) {
-        static std::mutex lock;
-        {
-            std::lock_guard<std::mutex> lk(lock);
-            EXPECT_THROW(thread_pool->stop(), InvalidOperation);
-            EXPECT_THROW(thread_pool->reset(), InvalidOperation);
-        }
-        runAndWait();
+        EXPECT_THROW(thread_pool->stop(), InvalidOperation);
+        EXPECT_THROW(thread_pool->reset(), InvalidOperation);
+        EXPECT_NO_THROW(runAndWait());
     }
 
     /// @brief reset all counters and internal test state
@@ -419,7 +415,7 @@ TEST_F(ThreadPoolTest, testStartAndStop) {
 
     // add items to running thread pool
     for (uint32_t i = 0; i < items_count; ++i) {
-        thread_pool.add(boost::make_shared<CallBack>(call_back));
+        EXPECT_NO_THROW(thread_pool.add(boost::make_shared<CallBack>(call_back)));
     }
 
     // wait for all items to be processed