![]() |
Bitcoin Core 31.1.0
P2P Digital Currency
|
#include <common/system.h>#include <logging.h>#include <random.h>#include <test/util/common.h>#include <util/string.h>#include <util/threadpool.h>#include <util/time.h>#include <boost/test/unit_test.hpp>#include <latch>#include <semaphore>Go to the source code of this file.
Classes | |
| struct | ThreadPoolFixture |
Macros | |
| #define | WAIT_FOR(futures) |
Functions | |
| template<typename F> | |
| auto | Submit (ThreadPool &pool, F &&fn) |
| std::vector< std::future< void > > | BlockWorkers (ThreadPool &threadPool, std::counting_semaphore<> &release_sem, size_t num_of_threads_to_block) |
| BOOST_AUTO_TEST_CASE (submit_fails_with_correct_error) | |
| BOOST_AUTO_TEST_CASE (submit_tasks_complete_successfully) | |
| BOOST_AUTO_TEST_CASE (single_available_worker_executes_all_tasks) | |
| BOOST_AUTO_TEST_CASE (wait_for_task_to_finish) | |
| BOOST_AUTO_TEST_CASE (get_result_from_completed_task) | |
| BOOST_AUTO_TEST_CASE (task_exception_propagates_to_future) | |
| BOOST_AUTO_TEST_CASE (process_tasks_manually_when_workers_busy) | |
| BOOST_AUTO_TEST_CASE (recursive_task_submission) | |
| BOOST_AUTO_TEST_CASE (task_submitted_while_busy_completes) | |
| BOOST_AUTO_TEST_CASE (congestion_more_workers_than_cores) | |
| BOOST_AUTO_TEST_CASE (interrupt_blocks_new_submissions) | |
| BOOST_AUTO_TEST_CASE (start_mid_stop_does_not_deadlock) | |
| BOOST_AUTO_TEST_CASE (queued_tasks_complete_after_interrupt) | |
| BOOST_AUTO_TEST_CASE (stop_active_wait_drains_queue) | |
Variables | |
| int | NUM_WORKERS_DEFAULT = 0 |
| constexpr char | POOL_NAME [] = "test" |
| constexpr auto | WAIT_TIMEOUT = 120s |
| #define WAIT_FOR | ( | futures | ) |
Definition at line 46 of file threadpool_tests.cpp.
| std::vector< std::future< void > > BlockWorkers | ( | ThreadPool & | threadPool, |
| std::counting_semaphore<> & | release_sem, | ||
| size_t | num_of_threads_to_block ) |
Definition at line 62 of file threadpool_tests.cpp.
| BOOST_AUTO_TEST_CASE | ( | congestion_more_workers_than_cores | ) |
| BOOST_AUTO_TEST_CASE | ( | get_result_from_completed_task | ) |
| BOOST_AUTO_TEST_CASE | ( | interrupt_blocks_new_submissions | ) |
| BOOST_AUTO_TEST_CASE | ( | process_tasks_manually_when_workers_busy | ) |
| BOOST_AUTO_TEST_CASE | ( | queued_tasks_complete_after_interrupt | ) |
| BOOST_AUTO_TEST_CASE | ( | recursive_task_submission | ) |
| BOOST_AUTO_TEST_CASE | ( | single_available_worker_executes_all_tasks | ) |
| BOOST_AUTO_TEST_CASE | ( | start_mid_stop_does_not_deadlock | ) |
| BOOST_AUTO_TEST_CASE | ( | stop_active_wait_drains_queue | ) |
| BOOST_AUTO_TEST_CASE | ( | submit_fails_with_correct_error | ) |
| BOOST_AUTO_TEST_CASE | ( | submit_tasks_complete_successfully | ) |
| BOOST_AUTO_TEST_CASE | ( | task_exception_propagates_to_future | ) |
| BOOST_AUTO_TEST_CASE | ( | task_submitted_while_busy_completes | ) |
| BOOST_AUTO_TEST_CASE | ( | wait_for_task_to_finish | ) |
|
nodiscard |
Definition at line 55 of file threadpool_tests.cpp.
| int NUM_WORKERS_DEFAULT = 0 |
Definition at line 18 of file threadpool_tests.cpp.
|
constexpr |
Definition at line 19 of file threadpool_tests.cpp.
|
constexpr |
Definition at line 20 of file threadpool_tests.cpp.