0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 11:18:51 +02:00

modules/net_dns_resolver: Lock tags mutex for cancel_all() on termination; add assertion.

This commit is contained in:
Jason Volk 2019-09-08 16:57:12 -07:00
parent 3e1be63a49
commit 0bc027ebab

View file

@ -172,6 +172,7 @@ uint16_t
ircd::net::dns::resolver::operator()(const hostport &hp,
const opts &opts)
{
const ctx::critical_assertion ca;
auto &tag(set_tag(hp, opts)); try
{
tag.question = make_query(tag.qbuf, tag);
@ -321,6 +322,11 @@ try
catch(const ctx::terminated &)
{
const ctx::exception_handler eh;
const std::lock_guard lock
{
mutex
};
cancel_all();
}