Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
James Lowden
OpenLDAP
Commits
61bdf0e6
Commit
61bdf0e6
authored
5 years ago
by
Howard Chu
Committed by
Quanah Gibson-Mount
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ITS#9181 Fix race on Windows mutex init
parent
4d590c95
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_int_thread.h
+4
-1
4 additions, 1 deletion
include/ldap_int_thread.h
libraries/libldap_r/thr_nt.c
+11
-0
11 additions, 0 deletions
libraries/libldap_r/thr_nt.c
with
15 additions
and
1 deletion
include/ldap_int_thread.h
+
4
−
1
View file @
61bdf0e6
...
...
@@ -180,10 +180,13 @@ typedef HANDLE ldap_int_thread_mutex_t;
typedef
HANDLE
ldap_int_thread_cond_t
;
typedef
DWORD
ldap_int_thread_key_t
;
LDAP_F
(
int
)
ldap_pvt_thread_mutex_init_first
LDAP_P
((
ldap_pvt_thread_mutex_t
*
mutex
));
#ifndef LDAP_INT_MUTEX_NULL
#define LDAP_INT_MUTEX_NULL ((HANDLE)0)
#define LDAP_INT_MUTEX_FIRSTCREATE(m) \
((void) ((m) ||
ldap_pvt_thread_mutex_init(&(m))
))
ldap_pvt_thread_mutex_init
_first
(&(m))
#endif
LDAP_END_DECL
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap_r/thr_nt.c
+
11
−
0
View file @
61bdf0e6
...
...
@@ -161,6 +161,17 @@ ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
return
(
0
);
}
int
ldap_pvt_thread_mutex_init_first
(
ldap_pvt_thread_mutex_t
*
mutex
)
{
if
(
*
mutex
==
NULL
)
{
HANDLE
p
=
CreateMutex
(
NULL
,
0
,
NULL
);
if
(
InterlockedCompareExchangePointer
((
PVOID
*
)
mutex
,
(
PVOID
)
p
,
NULL
)
!=
NULL
)
CloseHandle
(
p
);
}
return
(
0
);
}
int
ldap_pvt_thread_mutex_destroy
(
ldap_pvt_thread_mutex_t
*
mutex
)
{
...
...
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