Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ingo Voss
OpenLDAP
Commits
35eff96d
Commit
35eff96d
authored
Jun 10, 1999
by
Kurt Zeilenga
Browse files
Add Debug to help sort out race condition.
parent
368628e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/connection.c
View file @
35eff96d
...
...
@@ -142,7 +142,11 @@ static Connection* connection_get( int s )
{
/* connections_mutex should be locked by caller */
Connection
*
c
=
NULL
;
Connection
*
c
;
Debug
(
LDAP_DEBUG_ARGS
,
"connection_get(%d)
\n
"
,
s
,
0
,
0
);
assert
(
connections
!=
NULL
);
...
...
@@ -151,12 +155,17 @@ static Connection* connection_get( int s )
}
#ifndef HAVE_WINSOCK
assert
(
connections
[
s
].
c_struct_state
==
SLAP_C_USED
);
assert
(
connections
[
s
].
c_conn_state
!=
SLAP_C_INVALID
);
assert
(
ber_pvt_sb_in_use
(
connections
[
s
].
c_sb
)
);
c
=
&
connections
[
s
];
assert
(
c
->
c_struct_state
==
SLAP_C_USED
);
ldap_pvt_thread_mutex_lock
(
&
c
->
c_mutex
);
assert
(
c
->
c_conn_state
!=
SLAP_C_INVALID
);
assert
(
ber_pvt_sb_in_use
(
c
->
c_sb
)
);
#else
c
=
NULL
;
{
int
i
;
...
...
@@ -179,6 +188,7 @@ static Connection* connection_get( int s )
if
(
ber_pvt_sb_get_desc
(
connections
[
i
].
c_sb
)
==
s
)
{
c
=
&
connections
[
i
];
ldap_pvt_thread_mutex_lock
(
&
c
->
c_mutex
);
break
;
}
}
...
...
@@ -186,12 +196,10 @@ static Connection* connection_get( int s )
#endif
if
(
c
!=
NULL
)
{
/* we do this
BEFORE
locking to aid in debugging */
/* we do this
AFTER
locking to aid in debugging */
Debug
(
LDAP_DEBUG_TRACE
,
"connection_get(%d): got connid=%ld
\n
"
,
s
,
c
->
c_connid
,
0
);
ldap_pvt_thread_mutex_lock
(
&
c
->
c_mutex
);
}
return
c
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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