'rrn' needs to be treated atomically as it updated from multiple threads.
#include <stdlib.h>
#include <unistd.h>
+#include <isc/atomic.h>
#include <isc/util.h>
#include "test-data.h"
uint32_t ttl, int *modified) {
trpz_rr_t nrec = { 0 };
size_t n;
- static unsigned int rrn = 1;
+ static atomic_uint_fast32_t rrn = 1;
*modified = 0;
nrec.class = ns_c_in;
nrec.ttl = ttl;
- nrec.rrn = rrn++;
+ nrec.rrn = atomic_fetch_add_relaxed(&rrn, 1);
if (!strcasecmp(rrtype, "A")) {
uint32_t addr;