]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Also catch/throw in sendEvent() case
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 12:20:15 +0000 (14:20 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 12:20:15 +0000 (14:20 +0200)
pdns/mtasker.cc

index dd7ccc50bd11eae72cba5931aa2cfcf1b5ba1fc4..a02f6bcc9ef2649b2b0d460e0dfcaf4909c65847 100644 (file)
@@ -252,7 +252,13 @@ template<class EventKey, class EventVal, class Cmp>int MTasker<EventKey,EventVal
   auto userspace=std::move(waiter->context);
   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;
 }