From dd922c2168062b54c43de97f8889551d7fa6b3d9 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 13 Sep 2023 14:20:15 +0200 Subject: [PATCH] Also catch/throw in sendEvent() case --- pdns/mtasker.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pdns/mtasker.cc b/pdns/mtasker.cc index dd7ccc50bd..a02f6bcc9e 100644 --- a/pdns/mtasker.cc +++ b/pdns/mtasker.cc @@ -252,7 +252,13 @@ templateint MTaskercontext); d_waiters.erase(waiter); // removes the waitpoint notifyStackSwitch(d_threads[d_tid].startOfStack, d_stacksize); - pdns_swapcontext(d_kernel,*userspace); // swaps back to the above point 'A' + try { + pdns_swapcontext(d_kernel,*userspace); // swaps back to the above point 'A' + } + catch (...) { + notifyStackSwitchDone(); + throw; + } notifyStackSwitchDone(); return 1; } -- 2.47.2