mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
Use atomics to access find->status
This commit is contained in:
parent
c900300f21
commit
a45e39d114
@ -935,7 +935,7 @@ clean_finds_at_name(dns_adbname_t *name, dns_adbstatus_t astat,
|
|||||||
|
|
||||||
INSIST(!FIND_EVENTSENT(find));
|
INSIST(!FIND_EVENTSENT(find));
|
||||||
|
|
||||||
find->status = astat;
|
atomic_store(&find->status, astat);
|
||||||
|
|
||||||
DP(DEF_LEVEL, "cfan: sending find %p to caller", find);
|
DP(DEF_LEVEL, "cfan: sending find %p to caller", find);
|
||||||
|
|
||||||
@ -2222,7 +2222,7 @@ post_copy:
|
|||||||
if (want_event) {
|
if (want_event) {
|
||||||
INSIST((find->flags & DNS_ADBFIND_ADDRESSMASK) != 0);
|
INSIST((find->flags & DNS_ADBFIND_ADDRESSMASK) != 0);
|
||||||
find->loop = loop;
|
find->loop = loop;
|
||||||
find->status = DNS_ADB_UNSET;
|
atomic_store(&find->status, DNS_ADB_UNSET);
|
||||||
find->cb = cb;
|
find->cb = cb;
|
||||||
find->cbarg = cbarg;
|
find->cbarg = cbarg;
|
||||||
}
|
}
|
||||||
@ -2276,7 +2276,7 @@ dns_adb_destroyfind(dns_adbfind_t **findp) {
|
|||||||
static void
|
static void
|
||||||
find_sendevent(dns_adbfind_t *find) {
|
find_sendevent(dns_adbfind_t *find) {
|
||||||
if (!FIND_EVENTSENT(find)) {
|
if (!FIND_EVENTSENT(find)) {
|
||||||
find->status = DNS_ADB_CANCELED;
|
atomic_store(&find->status, DNS_ADB_CANCELED);
|
||||||
|
|
||||||
DP(DEF_LEVEL, "sending find %p to caller", find);
|
DP(DEF_LEVEL, "sending find %p to caller", find);
|
||||||
|
|
||||||
@ -2323,14 +2323,9 @@ dns_adb_cancelfind(dns_adbfind_t *find) {
|
|||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
dns_adb_findstatus(dns_adbfind_t *find) {
|
dns_adb_findstatus(dns_adbfind_t *find) {
|
||||||
unsigned int status;
|
|
||||||
REQUIRE(DNS_ADBFIND_VALID(find));
|
REQUIRE(DNS_ADBFIND_VALID(find));
|
||||||
|
|
||||||
UNLOCK(&find->lock);
|
return (atomic_load(&find->status));
|
||||||
status = find->status;
|
|
||||||
UNLOCK(&find->lock);
|
|
||||||
|
|
||||||
return (status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -121,15 +121,15 @@ struct dns_adbfind {
|
|||||||
ISC_LINK(dns_adbfind_t) publink; /*%< RW: client use */
|
ISC_LINK(dns_adbfind_t) publink; /*%< RW: client use */
|
||||||
|
|
||||||
/* Private */
|
/* Private */
|
||||||
isc_mutex_t lock; /* locks all below */
|
isc_mutex_t lock; /* locks all below */
|
||||||
in_port_t port;
|
in_port_t port;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
dns_adbname_t *adbname;
|
dns_adbname_t *adbname;
|
||||||
dns_adb_t *adb;
|
dns_adb_t *adb;
|
||||||
isc_loop_t *loop;
|
isc_loop_t *loop;
|
||||||
dns_adbstatus_t status;
|
_Atomic(dns_adbstatus_t) status;
|
||||||
isc_job_cb cb;
|
isc_job_cb cb;
|
||||||
void *cbarg;
|
void *cbarg;
|
||||||
ISC_LINK(dns_adbfind_t) plink;
|
ISC_LINK(dns_adbfind_t) plink;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user