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 /storage/innobase/trx/trx0purge.cc | |
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 'storage/innobase/trx/trx0purge.cc')
-rw-r--r-- | storage/innobase/trx/trx0purge.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 593a4556a70..a8bd4a5b93c 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1239,7 +1239,13 @@ extern tpool::waitable_task purge_worker_task; /** Wait for pending purge jobs to complete. */ static void trx_purge_wait_for_workers_to_complete() { - purge_worker_task.wait(); + if (purge_worker_task.get_ref_count()) + { + tpool::tpool_wait_begin(); + purge_worker_task.wait(); + tpool::tpool_wait_end(); + } + /* There should be no outstanding tasks as long as the worker threads are active. */ ut_ad(srv_get_task_queue_length() == 0); |