MDEV-21452: Replace all direct use of os_event_t

Let us replace os_event_t with mysql_cond_t, and replace the
necessary ib_mutex_t with mysql_mutex_t so that they can be
used with condition variables.

Also, let us replace polling (os_thread_sleep() or timed waits)
with plain mysql_cond_wait() wherever possible.

Furthermore, we will use the lightweight srw_mutex for trx_t::mutex,
to hopefully reduce contention on lock_sys.mutex.

FIXME: Add test coverage of
mariabackup --backup --kill-long-queries-timeout
This commit is contained in:
Marko Mäkelä 2020-12-04 16:18:04 +02:00
commit 38fd7b7d91
54 changed files with 1391 additions and 1798 deletions

View file

@ -1997,11 +1997,11 @@ retry_page_get:
trx_t* trx = thr_get_trx(cursor->thr);
lock_prdt_t prdt;
lock_mutex_enter();
mysql_mutex_lock(&lock_sys.mutex);
lock_init_prdt_from_mbr(
&prdt, &cursor->rtr_info->mbr, mode,
trx->lock.lock_heap);
lock_mutex_exit();
mysql_mutex_unlock(&lock_sys.mutex);
if (rw_latch == RW_NO_LATCH && height != 0) {
block->lock.s_lock();