summaryrefslogtreecommitdiff
path: root/storage/innobase/include/trx0purge.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-20 09:18:41 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-24 15:43:10 +0200
commit06ef5509d0be2ed8197a981e2b9ceb8ac2bab0cc (patch)
tree7f7be0f04b704c20aa61460d39375ce76d5a7c6a /storage/innobase/include/trx0purge.h
parent63dd2a97e4d12ee8000e7176b5b98543c079fee8 (diff)
downloadmariadb-git-06ef5509d0be2ed8197a981e2b9ceb8ac2bab0cc.tar.gz
MDEV-24167: Replace trx_purge_latch
Diffstat (limited to 'storage/innobase/include/trx0purge.h')
-rw-r--r--storage/innobase/include/trx0purge.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h
index 38e9e7207a2..0aff65fd7b6 100644
--- a/storage/innobase/include/trx0purge.h
+++ b/storage/innobase/include/trx0purge.h
@@ -29,6 +29,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rseg.h"
#include "que0types.h"
+#include "srw_lock.h"
#include <queue>
@@ -127,11 +128,9 @@ class purge_sys_t
{
public:
/** latch protecting view, m_enabled */
- MY_ALIGNED(CACHE_LINE_SIZE)
- mutable rw_lock_t latch;
+ MY_ALIGNED(CACHE_LINE_SIZE) mutable srw_lock latch;
private:
/** The purge will not remove undo logs which are >= this view */
- MY_ALIGNED(CACHE_LINE_SIZE)
ReadViewBase view;
/** whether purge is enabled; protected by latch and std::atomic */
std::atomic<bool> m_enabled;
@@ -249,23 +248,20 @@ public:
/** A wrapper around ReadView::changes_visible(). */
bool changes_visible(trx_id_t id, const table_name_t &name) const
{
- ut_ad(rw_lock_own(&latch, RW_LOCK_S));
return view.changes_visible(id, name);
}
/** A wrapper around ReadView::low_limit_no(). */
trx_id_t low_limit_no() const
{
-#if 0 /* Unfortunately we don't hold this assertion, see MDEV-22718. */
- ut_ad(rw_lock_own(&latch, RW_LOCK_S));
-#endif
+ /* MDEV-22718 FIXME: We are not holding latch here! */
return view.low_limit_no();
}
/** A wrapper around trx_sys_t::clone_oldest_view(). */
void clone_oldest_view()
{
- rw_lock_x_lock(&latch);
+ latch.wr_lock();
trx_sys.clone_oldest_view(&view);
- rw_lock_x_unlock(&latch);
+ latch.wr_unlock();
}
};