ROS 2 rclcpp + rcl - rolling  rolling-6c35dd21
ROS 2 C++ Client Library with ROS Client Library
Public Member Functions | Public Attributes | List of all members
rclcpp::executors::cbg_executor::WorkerQueue Struct Reference

#include </home/runner/work/api.nav2.org/api.nav2.org/work/rclcpp-rolling/rclcpp/src/rclcpp/executors/events_cbg_executor/scheduler.hpp>

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
 

Detailed Description

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.

Member Function Documentation

◆ pop_blocked_worker_thread()

Worker* rclcpp::executors::cbg_executor::WorkerQueue::pop_blocked_worker_thread ( )
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().

Here is the caller graph for this function:

◆ push_blocked_worker_thread()

bool rclcpp::executors::cbg_executor::WorkerQueue::push_blocked_worker_thread ( Worker *  worker)
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().

Here is the caller graph for this function:

◆ release_all_worker_threads()

std::deque<Worker *> rclcpp::executors::cbg_executor::WorkerQueue::release_all_worker_threads ( )
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.

◆ remove_worker_thread()

void rclcpp::executors::cbg_executor::WorkerQueue::remove_worker_thread ( Worker *  worker)
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.


The documentation for this struct was generated from the following file: