Commit e34e53b5 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24308: Revert for Windows

For some reason, InnoDB debug tests on Windows fail due to rw_lock_t
if the function call overhead for some os_thread_ code is removed.

This change worked fine on Windows in combination with MDEV-24142.
parent 8fa6e363
......@@ -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
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment