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
3f20324e
Commit
3f20324e
authored
19 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Add ldap_pvt_thread_pool_purgekey to free all instances of key across
all threads.
parent
838421f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ldap_pvt_thread.h
+3
-0
3 additions, 0 deletions
include/ldap_pvt_thread.h
libraries/libldap_r/tpool.c
+24
-0
24 additions, 0 deletions
libraries/libldap_r/tpool.c
with
27 additions
and
0 deletions
include/ldap_pvt_thread.h
+
3
−
0
View file @
3f20324e
...
...
@@ -202,6 +202,9 @@ ldap_pvt_thread_pool_setkey LDAP_P((
void
*
data
,
ldap_pvt_thread_pool_keyfree_t
*
kfree
));
LDAP_F
(
void
)
ldap_pvt_thread_pool_purgekey
LDAP_P
((
void
*
key
));
LDAP_F
(
void
*
)
ldap_pvt_thread_pool_context
LDAP_P
((
void
));
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap_r/tpool.c
+
24
−
0
View file @
3f20324e
...
...
@@ -616,6 +616,30 @@ int ldap_pvt_thread_pool_setkey(
return
ENOMEM
;
}
/* Free all elements with this key, no matter which thread they're in.
* May only be called while the pool is paused.
*/
void
ldap_pvt_thread_pool_purgekey
(
void
*
key
)
{
int
i
,
j
;
ldap_int_thread_key_t
*
ctx
;
for
(
i
=
0
;
i
<
LDAP_MAXTHR
;
i
++
)
{
if
(
thread_keys
[
i
].
ctx
)
{
ctx
=
thread_keys
[
i
].
ctx
;
for
(
j
=
0
;
j
<
MAXKEYS
;
j
++
)
{
if
(
ctx
[
j
].
ltk_key
==
key
)
{
if
(
ctx
[
j
].
ltk_free
)
ctx
[
j
].
ltk_free
(
ctx
[
j
].
ltk_key
,
ctx
[
j
].
ltk_data
);
ctx
[
j
].
ltk_key
=
NULL
;
ctx
[
j
].
ltk_free
=
NULL
;
break
;
}
}
}
}
}
/*
* This is necessary if the caller does not have access to the
* thread context handle (for example, a slapd plugin calling
...
...
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