summaryrefslogtreecommitdiff
path: root/storage/innobase/row/row0log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/row/row0log.cc')
-rw-r--r--storage/innobase/row/row0log.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 62678ac8f00..e4f7be83940 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -172,7 +172,7 @@ directly. When also head.bytes == tail.bytes, both counts will be
reset to 0 and the file will be truncated. */
struct row_log_t {
pfs_os_file_t fd; /*!< file descriptor */
- ib_mutex_t mutex; /*!< mutex protecting error,
+ mysql_mutex_t mutex; /*!< mutex protecting error,
max_trx and tail */
page_no_map* blobs; /*!< map of page numbers of off-page columns
that have been freed during table-rebuilding
@@ -363,7 +363,7 @@ row_log_online_op(
+ (trx_id ? DATA_TRX_ID_LEN : 0);
log = index->online_log;
- mutex_enter(&log->mutex);
+ mysql_mutex_lock(&log->mutex);
if (trx_id > log->max_trx) {
log->max_trx = trx_id;
@@ -471,7 +471,7 @@ write_failed:
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
err_exit:
- mutex_exit(&log->mutex);
+ mysql_mutex_unlock(&log->mutex);
}
/******************************************************//**
@@ -499,13 +499,13 @@ row_log_table_open(
ulint size, /*!< in: size of log record */
ulint* avail) /*!< out: available size for log record */
{
- mutex_enter(&log->mutex);
+ mysql_mutex_lock(&log->mutex);
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
if (log->error != DB_SUCCESS) {
err_exit:
- mutex_exit(&log->mutex);
+ mysql_mutex_unlock(&log->mutex);
return(NULL);
}
@@ -541,7 +541,7 @@ row_log_table_close_func(
{
row_log_t* log = index->online_log;
- ut_ad(mutex_own(&log->mutex));
+ mysql_mutex_assert_owner(&log->mutex);
if (size >= avail) {
const os_offset_t byte_offset
@@ -605,7 +605,7 @@ write_failed:
log->tail.total += size;
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
err_exit:
- mutex_exit(&log->mutex);
+ mysql_mutex_unlock(&log->mutex);
onlineddl_rowlog_rows++;
/* 10000 means 100.00%, 4525 means 45.25% */
@@ -1272,7 +1272,7 @@ row_log_table_get_pk(
return(NULL);
}
- mutex_enter(&log->mutex);
+ mysql_mutex_lock(&log->mutex);
/* log->error is protected by log->mutex. */
if (log->error == DB_SUCCESS) {
@@ -1411,7 +1411,7 @@ err_exit:
}
func_exit:
- mutex_exit(&log->mutex);
+ mysql_mutex_unlock(&log->mutex);
return(tuple);
}
@@ -3187,7 +3187,7 @@ row_log_allocate(
}
log->fd = OS_FILE_CLOSED;
- mutex_create(LATCH_ID_INDEX_ONLINE_LOG, &log->mutex);
+ mysql_mutex_init(index_online_log_key, &log->mutex, nullptr);
log->blobs = NULL;
log->table = table;
@@ -3270,7 +3270,7 @@ row_log_free(
my_large_free(log->crypt_tail, log->crypt_tail_size);
}
- mutex_free(&log->mutex);
+ mysql_mutex_destroy(&log->mutex);
ut_free(log);
}
@@ -3284,9 +3284,11 @@ row_log_get_max_trx(
dict_index_t* index) /*!< in: index, must be locked */
{
ut_ad(dict_index_get_online_status(index) == ONLINE_INDEX_CREATION);
+#ifdef SAFE_MUTEX
ut_ad(index->lock.have_x()
|| (index->lock.have_s()
- && mutex_own(&index->online_log->mutex)));
+ && mysql_mutex_is_owner(&index->online_log->mutex)));
+#endif
return(index->online_log->max_trx);
}