![]() |
MySQL 9.3.0
Source Code Documentation
|
Generic implementation of a pool. More...
#include <jit_executor_context_pool.h>
Public Member Functions | |
Pool (size_t size, const std::function< T(size_t)> &factory, const std::function< void(T)> &destructor={}) | |
T | get () |
void | release (T ctx) |
void | teardown () |
size_t | active_items () const |
void | discard (T ctx, bool set_contention_mode) |
Discards the affected context and turns ON contention mode for the pool. More... | |
Private Member Functions | |
void | increase_active_items () |
void | decrease_active_items (bool set_contention_mode=false) |
Private Attributes | |
std::mutex | m_mutex |
std::condition_variable | m_item_availability |
bool | m_teardown = false |
size_t | m_pool_size |
std::deque< T > | m_items |
std::function< T(size_t id)> | m_item_factory |
std::function< void(T)> | m_item_destructor |
size_t | m_active_items = 0 |
size_t | m_created_items = 0 |
bool | m_contention_mode = false |
Generic implementation of a pool.
|
inlineexplicit |
|
inline |
|
inlineprivate |
|
inline |
Discards the affected context and turns ON contention mode for the pool.
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |