diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-11-29 22:26:04 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-12-09 21:12:13 +0100 |
commit | 66de4fef763c7072f2dab3d1a54630f03b01197e (patch) | |
tree | 37dae43c00161550d3764a0cff27b2a2bc23e21d /tpool/tpool.h | |
parent | d3b2625ba0c84e97ce508088b41cc33201929aa2 (diff) | |
download | mariadb-git-66de4fef763c7072f2dab3d1a54630f03b01197e.tar.gz |
MDEV-16264 - some improvements
- wait notification, tpool_wait_begin/tpool_wait_end - to notify the
threadpool that current thread is going to wait
Use it to wait for IOs to complete and also when purge waits for workers.
Diffstat (limited to 'tpool/tpool.h')
-rw-r--r-- | tpool/tpool.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tpool/tpool.h b/tpool/tpool.h index 8659e8adc74..472e59d5d9e 100644 --- a/tpool/tpool.h +++ b/tpool/tpool.h @@ -214,6 +214,8 @@ public: int bind(native_file_handle &fd) { return m_aio->bind(fd); } void unbind(const native_file_handle &fd) { m_aio->unbind(fd); } int submit_io(aiocb *cb) { return m_aio->submit_io(cb); } + virtual void wait_begin() {}; + virtual void wait_end() {}; virtual ~thread_pool() {} }; const int DEFAULT_MIN_POOL_THREADS= 1; @@ -221,6 +223,8 @@ const int DEFAULT_MAX_POOL_THREADS= 500; extern thread_pool * create_thread_pool_generic(int min_threads= DEFAULT_MIN_POOL_THREADS, int max_threads= DEFAULT_MAX_POOL_THREADS); +extern "C" void tpool_wait_begin(); +extern "C" void tpool_wait_end(); #ifdef _WIN32 extern thread_pool * create_thread_pool_win(int min_threads= DEFAULT_MIN_POOL_THREADS, |