summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2021-03-16 23:34:55 +0300
committerEugene Kosov <claprix@yandex.ru>2021-03-19 11:44:17 +0300
commitda3428805efd2860a26f162cc1e4fff9d95f84e1 (patch)
tree0d889a72e3d424ccf99f2e7828aa6c94dfc97320
parent62e4aaa2407cc880618fb909c349c9c73174f84a (diff)
downloadmariadb-git-da3428805efd2860a26f162cc1e4fff9d95f84e1.tar.gz
cleanup: os_thread_yield() -> std::this_thread::yield()
-rw-r--r--storage/innobase/btr/btr0sea.cc4
-rw-r--r--storage/innobase/buf/buf0buf.cc4
-rw-r--r--storage/innobase/buf/buf0flu.cc2
-rw-r--r--storage/innobase/include/os0thread.h1
-rw-r--r--storage/innobase/row/row0ftsort.cc2
-rw-r--r--storage/innobase/row/row0merge.cc2
-rw-r--r--storage/innobase/row/row0mysql.cc2
-rw-r--r--storage/innobase/srv/srv0start.cc2
-rw-r--r--storage/innobase/trx/trx0purge.cc2
-rw-r--r--storage/innobase/trx/trx0trx.cc2
10 files changed, 11 insertions, 12 deletions
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index e27df6891b0..d637d41dd13 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -2171,7 +2171,7 @@ btr_search_hash_table_validate(ulint hash_table_id)
mysql_mutex_unlock(&buf_pool.mutex);
btr_search_x_unlock_all();
- os_thread_yield();
+ std::this_thread::yield();
btr_search_x_lock_all();
@@ -2279,7 +2279,7 @@ state_ok:
mysql_mutex_unlock(&buf_pool.mutex);
btr_search_x_unlock_all();
- os_thread_yield();
+ std::this_thread::yield();
btr_search_x_lock_all();
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e452a05445e..93178bada97 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -288,7 +288,7 @@ void page_hash_latch::read_lock_wait()
}
/* Fall back to yielding to other threads. */
do
- os_thread_yield();
+ std::this_thread::yield();
while (!read_trylock());
}
@@ -306,7 +306,7 @@ void page_hash_latch::write_lock_wait()
/* Fall back to yielding to other threads. */
do
- os_thread_yield();
+ std::this_thread::yield();
while (!write_lock_poll());
}
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index ee9a58b8d0e..dbb623b3054 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -260,7 +260,7 @@ void buf_flush_remove_pages(ulint id)
break;
mysql_mutex_unlock(&buf_pool.mutex);
- os_thread_yield();
+ std::this_thread::yield();
mysql_mutex_lock(&buf_pool.mutex);
buf_flush_wait_batch_end(false);
}
diff --git a/storage/innobase/include/os0thread.h b/storage/innobase/include/os0thread.h
index 3eca521937d..d53099148d4 100644
--- a/storage/innobase/include/os0thread.h
+++ b/storage/innobase/include/os0thread.h
@@ -60,7 +60,6 @@ extern "C" { typedef void* (*os_thread_func_t)(void*); }
typedef void* (*os_posix_f_t) (void*);
#define os_thread_eq(a,b) IF_WIN(a == b, pthread_equal(a, b))
-#define os_thread_yield() IF_WIN(SwitchToThread(), sched_yield())
#define os_thread_get_curr_id() IF_WIN(GetCurrentThreadId(), pthread_self())
/****************************************************************//**
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 3a8e0d15c49..891e9318da5 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -919,7 +919,7 @@ loop:
}
if (doc_item == NULL) {
- os_thread_yield();
+ std::this_thread::yield();
}
row_merge_fts_get_next_doc_item(psort_info, &doc_item);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 40295a7416e..3ebdd7fd208 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1994,7 +1994,7 @@ row_merge_read_clustered_index(
mtr_started = false;
/* Give the waiters a chance to proceed. */
- os_thread_yield();
+ std::this_thread::yield();
scan_next:
ut_ad(!mtr_started);
ut_ad(!mtr.is_active());
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 8e9f30815a9..cc648f0f2e1 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -4205,7 +4205,7 @@ row_rename_table_for_mysql(
for (retry = 0; retry < 100
&& table->n_foreign_key_checks_running > 0; ++retry) {
row_mysql_unlock_data_dictionary(trx);
- os_thread_yield();
+ std::this_thread::yield();
row_mysql_lock_data_dictionary(trx);
}
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index fe6225e9ccb..7df61a3922a 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1927,7 +1927,7 @@ void srv_shutdown_bg_undo_sources()
dict_stats_shutdown();
while (row_get_background_drop_list_len_low()) {
srv_inc_activity_count();
- os_thread_yield();
+ std::this_thread::yield();
}
srv_undo_sources = false;
}
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index 4b2185ed7ab..9d248061c59 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -967,7 +967,7 @@ trx_purge_choose_next_log(void)
trx_purge_read_undo_rec();
} else {
/* There is nothing to do yet. */
- os_thread_yield();
+ std::this_thread::yield();
}
}
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 2fd453f0386..1a0c8dd4868 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1378,7 +1378,7 @@ inline void trx_t::commit_in_memory(const mtr_t *mtr)
}
/* NOTE that we could possibly make a group commit more efficient
- here: call os_thread_yield here to allow also other trxs to come
+ here: call std::this_thread::yield() here to allow also other trxs to come
to commit! */
/*-------------------------------------*/