#include <thread_pool_for_testing.h>
Public Member Functions | |
std::weak_ptr< Task > | Schedule (std::unique_ptr< Task > task) LOCKS_EXCLUDED(mutex_) override |
ThreadPoolForTesting () | |
void | WaitUntilIdle () |
~ThreadPoolForTesting () | |
Private Member Functions | |
void | DoWork () |
bool running_ | GUARDED_BY (mutex_) |
bool idle_ | GUARDED_BY (mutex_) |
std::deque< std::shared_ptr < Task > > task_queue_ | GUARDED_BY (mutex_) |
std::map< Task *, std::shared_ptr< Task > > tasks_not_ready_ | GUARDED_BY (mutex_) |
std::thread thread_ | GUARDED_BY (mutex_) |
void | NotifyDependenciesCompleted (Task *task) LOCKS_EXCLUDED(mutex_) override |
Private Attributes | |
absl::Mutex | mutex_ |
Friends | |
class | Task |
Definition at line 32 of file thread_pool_for_testing.h.
Definition at line 35 of file thread_pool_for_testing.cc.
void cartographer::common::testing::ThreadPoolForTesting::DoWork | ( | ) | [private] |
bool running_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY | ( | mutex_ | ) | [private] |
bool idle_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY | ( | mutex_ | ) | [private] |
std::deque<std::shared_ptr<Task> > task_queue_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY | ( | mutex_ | ) | [private] |
std::map<Task*, std::shared_ptr<Task> > tasks_not_ready_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY | ( | mutex_ | ) | [private] |
std::thread thread_ cartographer::common::testing::ThreadPoolForTesting::GUARDED_BY | ( | mutex_ | ) | [private] |
void cartographer::common::testing::ThreadPoolForTesting::NotifyDependenciesCompleted | ( | Task * | task | ) | [override, private, virtual] |
Implements cartographer::common::ThreadPoolInterface.
std::weak_ptr<Task> cartographer::common::testing::ThreadPoolForTesting::Schedule | ( | std::unique_ptr< Task > | task | ) | [override, virtual] |
Implements cartographer::common::ThreadPoolInterface.
friend class Task [friend] |
Reimplemented from cartographer::common::ThreadPoolInterface.
Definition at line 43 of file thread_pool_for_testing.h.
absl::Mutex cartographer::common::testing::ThreadPoolForTesting::mutex_ [private] |
Definition at line 49 of file thread_pool_for_testing.h.