mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
modules/net_dns_resolver: Lock tags mutex for cancel_all() on termination; add assertion.
This commit is contained in:
parent
3e1be63a49
commit
0bc027ebab
1 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue