Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johan Pascal
OpenLDAP
Commits
729fb83d
Commit
729fb83d
authored
26 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Import pthread detection changes from devel.
parent
c032cb29
No related branches found
Branches containing commit
Tags
OPENLDAP_REL_ENG_1_1_0
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
configure
+402
-347
402 additions, 347 deletions
configure
configure.in
+35
-17
35 additions, 17 deletions
configure.in
include/portable.h.in
+29
-2
29 additions, 2 deletions
include/portable.h.in
with
466 additions
and
366 deletions
configure
+
402
−
347
View file @
729fb83d
This diff is collapsed.
Click to expand it.
configure.in
+
35
−
17
View file @
729fb83d
...
...
@@ -485,6 +485,15 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
LIBS="$save_LIBS"
fi
if test $ol_link_threads = no ; then
dnl try -lpthreads
save_LIBS="$LIBS"
AC_CHECK_LIB(pthreads, pthread_create, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"])
LIBS="$save_LIBS"
fi
if test $ol_link_threads != no ; then
AC_DEFINE(HAVE_PTHREADS)
...
...
@@ -602,10 +611,10 @@ static void *task(p)
if(i < 0) {
perror("select");
exit(0);
exit(
1
0);
}
exit(
1
); /* if we exit here, the select blocked the whole process */
exit(
0
); /* if we exit here, the select blocked the whole process */
}
int main(argc, argv)
...
...
@@ -617,7 +626,7 @@ int main(argc, argv)
/* create a pipe to select */
if(pipe(&fildes[0])) {
perror("select");
exit(
0
);
exit(
1
);
}
#ifdef HAVE_PTHREAD_SETCONCURRENCY
...
...
@@ -638,10 +647,11 @@ int main(argc, argv)
pthread_yield(); /* make sure task runs first */
#endif
#endif
exit(0);
exit(2);
}],
[ol_cv_pthread_select_yields=
yes
],
[ol_cv_pthread_select_yields=
no
], [
[ol_cv_pthread_select_yields=
no
],
[ol_cv_pthread_select_yields=
yes
], [
AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])])
AC_MSG_RESULT($ol_cv_pthread_select_yields)
...
...
@@ -650,17 +660,6 @@ int main(argc, argv)
fi
fi
dnl dnl check for reentrant/threadsafe functions
dnl AC_CHECK_FUNCS( \
dnl feof_unlocked \
dnl unlocked_feof \
dnl ftrylockfile \
dnl flockfile \
dnl putc_unlocked \
dnl gmtime_r \
dnl strtok_r \
dnl )
dnl restore flags
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
...
...
@@ -803,6 +802,25 @@ int x = errno;
LIBS="$LTHREAD_LIBS $LIBS"
LTHREAD_LIBS=""
fi
dnl check for reentrant/threadsafe functions
dnl
dnl note: these should only be used when linking
dnl with $LTHREAD_LIBS
dnl
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
LIBS="$LTHREAD_LIBS $LIBS"
AC_CHECK_FUNCS( \
strtok_r \
gmtime_r \
gethostbyaddr_r gethostbyname_r \
feof_unlocked unlocked_feof \
putc_unlocked unlocked_putc \
flockfile ftrylockfile \
)
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
fi
dnl ----------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
include/portable.h.in
+
29
−
2
View file @
729fb83d
...
...
@@ -279,15 +279,27 @@ is provided ``as is'' without express or implied warranty.
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
/* Define if you have the
des_string_to_
ke
y
function. */
#undef HAVE_
DES_STRING_TO_
KE
Y
/* Define if you have the
feof_unloc
ke
d
function. */
#undef HAVE_
FEOF_UNLOC
KE
D
/* Define if you have the flock function. */
#undef HAVE_FLOCK
/* Define if you have the flockfile function. */
#undef HAVE_FLOCKFILE
/* Define if you have the ftrylockfile function. */
#undef HAVE_FTRYLOCKFILE
/* Define if you have the getdtablesize function. */
#undef HAVE_GETDTABLESIZE
/* Define if you have the gethostbyaddr_r function. */
#undef HAVE_GETHOSTBYADDR_R
/* Define if you have the gethostbyname_r function. */
#undef HAVE_GETHOSTBYNAME_R
/* Define if you have the gethostname function. */
#undef HAVE_GETHOSTNAME
...
...
@@ -300,6 +312,9 @@ is provided ``as is'' without express or implied warranty.
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the gmtime_r function. */
#undef HAVE_GMTIME_R
/* Define if you have the lockf function. */
#undef HAVE_LOCKF
...
...
@@ -339,6 +354,9 @@ is provided ``as is'' without express or implied warranty.
/* Define if you have the pthread_yield function. */
#undef HAVE_PTHREAD_YIELD
/* Define if you have the putc_unlocked function. */
#undef HAVE_PUTC_UNLOCKED
/* Define if you have the res_search function. */
#undef HAVE_RES_SEARCH
...
...
@@ -387,6 +405,9 @@ is provided ``as is'' without express or implied warranty.
/* Define if you have the strtok function. */
#undef HAVE_STRTOK
/* Define if you have the strtok_r function. */
#undef HAVE_STRTOK_R
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
...
...
@@ -402,6 +423,12 @@ is provided ``as is'' without express or implied warranty.
/* Define if you have the thr_setconcurrency function. */
#undef HAVE_THR_SETCONCURRENCY
/* Define if you have the unlocked_feof function. */
#undef HAVE_UNLOCKED_FEOF
/* Define if you have the unlocked_putc function. */
#undef HAVE_UNLOCKED_PUTC
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment