mirror of
https://github.com/isc-projects/bind9.git
synced 2026-07-15 10:00:55 -04:00
Only update the global tid_count once
Normally, the tid_count is initialized only once at the beginning of the
application. The only exception is the pattern in the unit test where
isc_loopmgr is repeatedly created and torn down and each creation of
isc_loopmgr_t calls isc__tid_initcount() with the previous value.
ThreadSanitizer sees that as write operation on unprotected memory are
reports this as data race even though the value has not really changed.
This has been fixed by skipping the tid_count value update on repeated
calls.
(cherry picked from commit a570e37c06)
This commit is contained in:
parent
a1e824e26e
commit
1846bbbc31
1 changed files with 3 additions and 2 deletions
|
|
@ -11,7 +11,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
@ -44,7 +43,9 @@ isc__tid_init(uint32_t tid) {
|
|||
void
|
||||
isc__tid_initcount(uint32_t count) {
|
||||
REQUIRE(tid_count == 0 || tid_count == count);
|
||||
tid_count = count;
|
||||
if (tid_count == 0) {
|
||||
tid_count = count;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue