![]() |
MySQL 26.7.0
Source Code Documentation
|
Shared state for one logical repeatable scheduler task. More...
#include <scheduled_task.h>
Public Types | |
| using | Repeatable_task_type = std::function< bool(unsigned int)> |
Public Member Functions | |
| Repeatable_task_state (std::atomic< std::size_t > &scheduled_tasks_cnt, Repeatable_task_type &&repeatable_task) | |
| Creates shared state for a logical repeatable task. More... | |
| ~Repeatable_task_state () | |
| Decrements the logical scheduled task count. More... | |
| Repeatable_task_state (const Repeatable_task_state &)=delete | |
| Repeatable_task_state & | operator= (const Repeatable_task_state &)=delete |
| bool | execute (unsigned int thread_id) |
| Executes the repeatable task body for one phase dispatch. More... | |
Private Attributes | |
| std::atomic< std::size_t > & | m_scheduled_tasks_cnt |
| Reference to the scheduler's logical task counter. More... | |
| Repeatable_task_type | m_repeatable_task |
| Repeatable task body shared by all scheduled task instances. More... | |
Shared state for one logical repeatable scheduler task.
This object is shared by all scheduled representations of the same logical task, including the currently queued phase, the task handed off to a worker, and any follow-up phase enqueued by the scheduler.
It combines:
m_scheduled_tasks_cnt The scheduler increments m_scheduled_tasks_cnt once when the logical task is created. The counter is decremented in this object's destructor, which means the decrement happens only after the last queued or running owner of the logical task releases its shared reference.
| using mysql::scheduler::Repeatable_task_state::Repeatable_task_type = std::function<bool(unsigned int)> |
| mysql::scheduler::Repeatable_task_state::Repeatable_task_state | ( | std::atomic< std::size_t > & | scheduled_tasks_cnt, |
| Repeatable_task_type && | repeatable_task | ||
| ) |
Creates shared state for a logical repeatable task.
| scheduled_tasks_cnt | Reference to the scheduler task counter. |
| repeatable_task | Repeatable task callable shared across phases. |
| mysql::scheduler::Repeatable_task_state::~Repeatable_task_state | ( | ) |
Decrements the logical scheduled task count.
|
delete |
|
inline |
Executes the repeatable task body for one phase dispatch.
| thread_id | Worker or scheduler thread identifier. |
|
delete |
|
private |
Repeatable task body shared by all scheduled task instances.
|
private |
Reference to the scheduler's logical task counter.