|
ROS 2 rclcpp + rcl - rolling
rolling-6c35dd21
ROS 2 C++ Client Library with ROS Client Library
|
Public Member Functions | |
| Worker * | pop_blocked_worker_thread () |
| bool | push_blocked_worker_thread (Worker *worker) |
| void | remove_worker_thread (Worker *worker) |
| std::deque< Worker * > | release_all_worker_threads () |
Public Attributes | |
| std::mutex | workers_mutex |
| std::deque< Worker * > | workers |
| bool | release_workers = false |
Queue of blocked (idle) worker threads.
All member functions must be called while holding workers_mutex. The mutex is exposed so that the scheduler can lock it together with its own ready_callback_groups_mutex, which is needed to make "check for work and enqueue self" atomic with respect to "add work and wake a worker".
Definition at line 101 of file scheduler.hpp.
|
inline |
Removes and returns the most recently blocked worker, or nullptr if no worker is blocked.
Definition at line 112 of file scheduler.hpp.
Referenced by rclcpp::executors::cbg_executor::CBGScheduler::unblock_one_worker_thread().

|
inline |
Registers the worker as blocked. Returns false if the queue was released and the worker must not block.
Definition at line 127 of file scheduler.hpp.
Referenced by rclcpp::executors::cbg_executor::CBGScheduler::prepare_and_enqueue_worker().

|
inline |
Removes all blocked workers from the queue and marks the queue as released. Returns the removed workers, the caller must unblock them after dropping the lock.
Definition at line 154 of file scheduler.hpp.
|
inline |
Removes the given worker from the queue, if it is still in there. Needed for timed blocks, where the worker may wake up on its own without anyone having removed it from the queue.
Definition at line 141 of file scheduler.hpp.