Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
ed898b28
Commit
ed898b28
authored
Jan 06, 2006
by
Kurt Zeilenga
Browse files
Replace sched_yield(2) on Linux with select(2) (ITS#3950)
parent
ba8a18a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
ed898b28
OpenLDAP 2.3 Change Log
OpenLDAP 2.3.16 Engineering
Build environment
Replace sched_yield(2) on Linux with select(2) (ITS#3950)
OpenLDAP 2.3.15 Release
Fixed slapd strerror logging bug (ITS#4292)
...
...
configure
View file @
ed898b28
#! /bin/sh
# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.560.2.
18
200
5/11/26 17:01:54
kurt Exp .
# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.560.2.
20
200
6/01/03 22:16:00
kurt Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
...
...
@@ -24740,6 +24740,21 @@ echo "${ECHO_T}$ol_cv_pthread_create_works" >&6
{ { echo "$as_me:$LINENO: error: pthread_create is not usable, check environment settings" >&5
echo "$as_me: error: pthread_create is not usable, check environment settings" >&2;}
{ (exit 1); exit 1; }; }
fi
ol_replace_broken_yield=no
case "$target" in
*-*-linux*)
ol_replace_broken_yield=yes
;;
esac
if test $ol_replace_broken_yield = yes ; then
cat >>confdefs.h <<\_ACEOF
#define REPLACE_BROKEN_YIELD 1
_ACEOF
fi
if test $ol_with_yielding_select = auto ; then
...
...
@@ -42898,7 +42913,6 @@ fi
for ac_func in \
...
...
@@ -42950,7 +42964,6 @@ for ac_func in \
strtoll \
strspn \
sysconf \
usleep \
waitpid \
wait4 \
write \
configure.in
View file @
ed898b28
...
...
@@ -1585,6 +1585,18 @@ dnl [ol_cv_pthread_lpthread_lexc])
AC_MSG_ERROR([pthread_create is not usable, check environment settings])
fi
ol_replace_broken_yield=no
case "$target" in
*-*-linux*)
ol_replace_broken_yield=yes
;;
esac
if test $ol_replace_broken_yield = yes ; then
AC_DEFINE([REPLACE_BROKEN_YIELD],1,
[define if sched_yield yields the entire process])
fi
dnl Check if select causes an yield
if test $ol_with_yielding_select = auto ; then
AC_CACHE_CHECK([if select yields when using pthreads],
...
...
@@ -2564,7 +2576,6 @@ AC_CHECK_FUNCS( \
strtoll \
strspn \
sysconf \
usleep \
waitpid \
wait4 \
write \
...
...
include/portable.hin
View file @
ed898b28
...
...
@@ -777,9 +777,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
...
...
@@ -903,6 +900,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* define if sched_yield yields the entire process */
#undef REPLACE_BROKEN_YIELD
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
...
...
libraries/libldap_r/thr_posix.c
View file @
ed898b28
...
...
@@ -20,6 +20,13 @@
#include
<ac/errno.h>
#ifdef REPLACE_BROKEN_YIELD
#ifndef HAVE_NANOSLEEP
#include
<ac/socket.h>
#endif
#include
<ac/time.h>
#endif
#include
"ldap_pvt_thread.h"
/* Get the thread interface */
#define LDAP_THREAD_IMPLEMENTATION
#define LDAP_THREAD_RDWR_IMPLEMENTATION
...
...
@@ -207,7 +214,16 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
int
ldap_pvt_thread_yield
(
void
)
{
#if HAVE_THR_YIELD
#ifdef REPLACE_BROKEN_YIELD
#ifdef HAVE_NANOSLEEP
struct
timespec
t
=
{
0
,
0
};
nanosleep
(
&
t
,
NULL
);
#else
struct
timeval
tv
=
{
0
,
0
};
select
(
0
,
NULL
,
NULL
,
NULL
,
&
tv
);
#endif
return
0
;
#elif HAVE_THR_YIELD
return
thr_yield
();
#elif HAVE_PTHREADS == 10
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment