os0thread.c Change pthread_yield to sched_yield

univ.i  	Change pthread_yield to sched_yield
configure.in	Change pthread_yield to sched_yield
This commit is contained in:
heikki@donna.mysql.fi 2001-04-18 17:23:06 +03:00
parent 5a5e2be98a
commit e593714e6b
4 changed files with 9 additions and 3 deletions

View file

@ -2,3 +2,4 @@ sasha@mysql.sashanet.com
monty@donna.mysql.fi
serg@serg.mysql.com
jcole@abel.spaceapes.com
heikki@donna.mysql.fi

View file

@ -7,8 +7,9 @@ AM_INIT_AUTOMAKE(ib, 0.90)
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_HEADERS(aio.h)
AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_FUNCS(sched_yield)
AC_C_INLINE
AC_C_BIGENDIAN

View file

@ -39,6 +39,10 @@ subdirectory of 'mysql'. */
/* Include the header file generated by GNU autoconf */
#include "../ib_config.h"
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
#ifdef HAVE_PREAD
#define HAVE_PWRITE
#endif

View file

@ -137,8 +137,8 @@ os_thread_yield(void)
{
#if defined(__WIN__)
Sleep(0);
#elif defined(HAVE_PTHREAD_YIELD)
pthread_yield();
#elif (defined(HAVE_SCHED_YIELD) && defined(HAVE_SCHED_H))
sched_yield();
#else
os_thread_sleep(0);
#endif