Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
5e5b467e
Commit
5e5b467e
authored
Mar 16, 2005
by
Mark Andrews
Browse files
1833. [bug] Race condition in isc_mutex_lock_profile(). [RT #13660]
parent
713ad87a
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
5e5b467e
1833. [bug] Race condition in isc_mutex_lock_profile(). [RT #13660]
1832. [bug] named fails to return BADKEY on unknown TSIG algorithm.
[RT #13620]
...
...
lib/isc/pthreads/mutex.c
View file @
5e5b467e
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mutex.c,v 1.
8
200
4
/03/
05 05:11:16
marka Exp $ */
/* $Id: mutex.c,v 1.
9
200
5
/03/
16 01:56:17
marka Exp $ */
#include
<config.h>
...
...
@@ -126,19 +126,6 @@ isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) {
isc_mutexlocker_t
*
locker
=
NULL
;
int
i
;
for
(
i
=
0
;
i
<
ISC_MUTEX_MAX_LOCKERS
;
i
++
)
{
if
(
mp
->
stats
->
lockers
[
i
].
file
==
NULL
)
{
locker
=
&
mp
->
stats
->
lockers
[
i
];
locker
->
file
=
file
;
locker
->
line
=
line
;
break
;
}
else
if
(
mp
->
stats
->
lockers
[
i
].
file
==
file
&&
mp
->
stats
->
lockers
[
i
].
line
==
line
)
{
locker
=
&
mp
->
stats
->
lockers
[
i
];
break
;
}
}
gettimeofday
(
&
prelock_t
,
NULL
);
if
(
pthread_mutex_lock
(
&
mp
->
mutex
)
!=
0
)
...
...
@@ -152,6 +139,19 @@ isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) {
mp
->
stats
->
count
++
;
timevaladd
(
&
mp
->
stats
->
wait_total
,
&
postlock_t
);
for
(
i
=
0
;
i
<
ISC_MUTEX_MAX_LOCKERS
;
i
++
)
{
if
(
mp
->
stats
->
lockers
[
i
].
file
==
NULL
)
{
locker
=
&
mp
->
stats
->
lockers
[
i
];
locker
->
file
=
file
;
locker
->
line
=
line
;
break
;
}
else
if
(
mp
->
stats
->
lockers
[
i
].
file
==
file
&&
mp
->
stats
->
lockers
[
i
].
line
==
line
)
{
locker
=
&
mp
->
stats
->
lockers
[
i
];
break
;
}
}
if
(
locker
!=
NULL
)
{
locker
->
count
++
;
timevaladd
(
&
locker
->
wait_total
,
&
postlock_t
);
...
...
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