[9.20] fix: dev: Only update the global tid_count once

Skip updating the `tid_count` value on repeated calls to prevent ThreadSanitizer 'data race'.

Backport of MR !12186

Merge branch 'backport-ondrej/skip-repeated-tid_count-update-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!12188
This commit is contained in:
Ondřej Surý 2026-06-04 13:27:52 +02:00
commit 746d9bfd3a

View file

@ -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;
}
}
/**