Commit e593714e authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi

os0thread.c Change pthread_yield to sched_yield

univ.i  	Change pthread_yield to sched_yield
configure.in	Change pthread_yield to sched_yield
parent 5a5e2be9
...@@ -2,3 +2,4 @@ sasha@mysql.sashanet.com ...@@ -2,3 +2,4 @@ sasha@mysql.sashanet.com
monty@donna.mysql.fi monty@donna.mysql.fi
serg@serg.mysql.com serg@serg.mysql.com
jcole@abel.spaceapes.com jcole@abel.spaceapes.com
heikki@donna.mysql.fi
...@@ -7,8 +7,9 @@ AM_INIT_AUTOMAKE(ib, 0.90) ...@@ -7,8 +7,9 @@ AM_INIT_AUTOMAKE(ib, 0.90)
AC_PROG_CC AC_PROG_CC
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_INSTALL AC_PROG_INSTALL
AC_CHECK_HEADERS(aio.h) AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(int, 4)
AC_CHECK_FUNCS(sched_yield)
AC_C_INLINE AC_C_INLINE
AC_C_BIGENDIAN AC_C_BIGENDIAN
......
...@@ -39,6 +39,10 @@ subdirectory of 'mysql'. */ ...@@ -39,6 +39,10 @@ subdirectory of 'mysql'. */
/* Include the header file generated by GNU autoconf */ /* Include the header file generated by GNU autoconf */
#include "../ib_config.h" #include "../ib_config.h"
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
#ifdef HAVE_PREAD #ifdef HAVE_PREAD
#define HAVE_PWRITE #define HAVE_PWRITE
#endif #endif
......
...@@ -137,8 +137,8 @@ os_thread_yield(void) ...@@ -137,8 +137,8 @@ os_thread_yield(void)
{ {
#if defined(__WIN__) #if defined(__WIN__)
Sleep(0); Sleep(0);
#elif defined(HAVE_PTHREAD_YIELD) #elif (defined(HAVE_SCHED_YIELD) && defined(HAVE_SCHED_H))
pthread_yield(); sched_yield();
#else #else
os_thread_sleep(0); os_thread_sleep(0);
#endif #endif
......
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