summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-30 14:04:01 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-30 14:04:01 +0200
commitcde525f94a37be54e928837b8f584d1d9681dfe0 (patch)
treec6698bb6922c72eb19a9a11ef2e2dec88c9816bd
parentfc6a7e90ea720d201e9376d4c4c758c717c010a8 (diff)
parente34e53b554e8c3e05e3bd918204cf7ba494b1ae3 (diff)
downloadmariadb-git-cde525f94a37be54e928837b8f584d1d9681dfe0.tar.gz
Merge 10.5 into 10.6
-rw-r--r--storage/innobase/include/os0thread.h12
-rw-r--r--storage/innobase/os/os0thread.cc6
2 files changed, 15 insertions, 3 deletions
diff --git a/storage/innobase/include/os0thread.h b/storage/innobase/include/os0thread.h
index 8b293972c13..ed989045f18 100644
--- a/storage/innobase/include/os0thread.h
+++ b/storage/innobase/include/os0thread.h
@@ -66,9 +66,15 @@ typedef void* (*os_posix_f_t) (void*);
typedef unsigned int mysql_pfs_key_t;
#endif /* HAVE_PSI_INTERFACE */
-#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())
+#ifndef _WIN32
+#define os_thread_eq(a,b) pthread_equal(a, b)
+#define os_thread_yield() sched_yield()
+#define os_thread_get_curr_id() pthread_self()
+#else
+bool os_thread_eq(os_thread_id_t a, os_thread_id_t b);
+void os_thread_yield();
+os_thread_id_t os_thread_get_curr_id();
+#endif
/****************************************************************//**
Creates a new thread of execution. The execution starts from
diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc
index 2c5e20941e3..f3533acfaac 100644
--- a/storage/innobase/os/os0thread.cc
+++ b/storage/innobase/os/os0thread.cc
@@ -27,6 +27,12 @@ Created 9/8/1995 Heikki Tuuri
#include "univ.i"
#include "srv0srv.h"
+#ifdef _WIN32
+bool os_thread_eq(os_thread_id_t a, os_thread_id_t b) { return a == b; }
+void os_thread_yield() { SwitchToThread(); }
+os_thread_id_t os_thread_get_curr_id() { return GetCurrentThreadId(); }
+#endif
+
/****************************************************************//**
Creates a new thread of execution. The execution starts from
the function given.