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
Christopher Ng
OpenLDAP
Commits
dfa8bdec
Commit
dfa8bdec
authored
22 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Fine-tuning pthreads revision dependencies
parent
8758a30b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap_r/thr_posix.c
+14
-3
14 additions, 3 deletions
libraries/libldap_r/thr_posix.c
with
14 additions
and
3 deletions
libraries/libldap_r/thr_posix.c
+
14
−
3
View file @
dfa8bdec
...
...
@@ -76,10 +76,17 @@ ldap_pvt_thread_get_concurrency(void)
}
#endif
/* These are first defined in Draft 7 */
/* detachstate appeared in Draft 6, but without manifest constants.
* in Draft 7 they were called PTHREAD_CREATE_UNDETACHED and ...DETACHED.
* in Draft 8 on, ...UNDETACHED became ...JOINABLE.
*/
#ifndef PTHREAD_CREATE_JOINABLE
#ifdef PTHREAD_CREATE_UNDETACHED
#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED
#else
#define PTHREAD_CREATE_JOINABLE 0
#endif
#endif
#ifndef PTHREAD_CREATE_DETACHED
#define PTHREAD_CREATE_DETACHED 1
...
...
@@ -93,6 +100,8 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
{
int
rtn
;
pthread_attr_t
attr
;
/* Always create the thread attrs, so we can set stacksize if we need to */
#if HAVE_PTHREADS > 4
pthread_attr_init
(
&
attr
);
#else
...
...
@@ -104,7 +113,7 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
pthread_attr_setstacksize
(
&
attr
,
LDAP_PVT_THREAD_STACK_SIZE
);
#endif
#if HAVE_PTHREADS >
4
#if HAVE_PTHREADS >
5
detach
=
detach
?
PTHREAD_CREATE_DETACHED
:
PTHREAD_CREATE_JOINABLE
;
#if HAVE_PTHREADS == 6
pthread_attr_setdetachstate
(
&
attr
,
&
detach
);
...
...
@@ -117,6 +126,8 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
pthread_attr_destroy
(
&
attr
);
#else
pthread_attr_delete
(
&
attr
);
#endif
#if HAVE_PTHREADS < 6
if
(
detach
)
{
pthread_detach
(
thread
);
}
...
...
@@ -155,7 +166,7 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
{
#if HAVE_PTHREADS > 6
return
pthread_kill
(
thread
,
signo
);
#elif HAVE_PTHREADS
== 6
#elif HAVE_PTHREADS
> 4
if
(
pthread_kill
(
thread
,
signo
)
<
0
)
return
errno
;
return
0
;
#else
...
...
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