From c3b9a89e369047691ac60eaf72cd71bac0bfbf2a Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 13 Sep 2023 15:22:36 +0200 Subject: [PATCH] And another case for catch/throw --- pdns/mtasker.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pdns/mtasker.cc b/pdns/mtasker.cc index a02f6bcc9e..1579534718 100644 --- a/pdns/mtasker.cc +++ b/pdns/mtasker.cc @@ -380,7 +380,13 @@ templatebool MTasker::schedule(con ttdindex.erase(i++); // removes the waitpoint notifyStackSwitch(d_threads[d_tid].startOfStack, d_stacksize); - pdns_swapcontext(d_kernel, *uc); // swaps back to the above point 'A' + try { + pdns_swapcontext(d_kernel, *uc); // swaps back to the above point 'A' + } + catch (...) { + notifyStackSwitchDone(); + throw; + } notifyStackSwitchDone(); } else if(i->ttd.tv_sec) -- 2.47.2