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
0daf8012
Commit
0daf8012
authored
Apr 16, 2020
by
Ryan Tandy
Committed by
Quanah Gibson-Mount
Apr 16, 2020
Browse files
ITS#9181 fix ldap_pvt_thread_mutex_t used before its definition
parent
2022e7be
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ldap_int_thread.h
View file @
0daf8012
...
...
@@ -181,12 +181,12 @@ 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_
pv
t_thread_mutex_t
*
mutex
));
ldap_
int_mutex_firstcreate
LDAP_P
((
ldap_
in
t_thread_mutex_t
*
mutex
));
#ifndef LDAP_INT_MUTEX_NULL
#define LDAP_INT_MUTEX_NULL ((HANDLE)0)
#define LDAP_INT_MUTEX_FIRSTCREATE(m) \
ldap_
pvt_thread_mutex_init_first
(&(m))
ldap_
int_mutex_firstcreate
(&(m))
#endif
LDAP_END_DECL
...
...
libraries/libldap_r/thr_nt.c
View file @
0daf8012
...
...
@@ -54,6 +54,17 @@ ldap_int_thread_destroy( void )
return
0
;
}
int
ldap_int_mutex_firstcreate
(
ldap_int_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_create
(
ldap_pvt_thread_t
*
thread
,
int
detach
,
...
...
@@ -161,17 +172,6 @@ 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
)
{
...
...
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