From a57690123ae3ce5bdd7e970690f1380e88e4eaf6 Mon Sep 17 00:00:00 2001
From: Benoit Germain
Date: Mon, 17 Mar 2025 12:34:08 +0100
Subject: Raise a regular Lua error instead of throwing a C++ std::logic_error
exception in Universe::UniverseGC
---
docs/index.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'docs')
diff --git a/docs/index.html b/docs/index.html
index 28acf3b..d0f3940 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -70,7 +70,7 @@
- This document was revised on 13-Dec-24, and applies to version 4.0.0.
+ This document was revised on 17-Mar-25, and applies to version 4.0.0.
@@ -380,6 +380,8 @@
Sets the duration in seconds Lanes will wait for graceful termination of running lanes at application shutdown. Default is 0.25.
Lanes signals all lanes for cancellation with "soft", "hard", and "all" modes, in that order. Each attempt has shutdown_timeout seconds to succeed before the next one.
Then there is a last chance at cleanup with lanes.finally(). If some lanes are still running after that point, shutdown will either freeze or throw. It is YOUR responsibility to cleanup properly after yourself.
+ IMPORTANT: If there are still running lanes at shutdown, an error is raised, which will be propagated by Lua to the handler installed by lua_setwarnf. If the finalizer returned a value, this will be used as the error message.
+ LANES SHUTDOWN WILL NOT BE COMPLETE IN THAT CASE, AND THE SUBSEQUENT CONSEQUENCES ARE UNDEFINED!
@@ -487,7 +489,7 @@
The finalizer is called unprotected from inside __gc metamethod of Lanes's Universe. Therefore, if your finalizer raises an error, Lua rules regarding errors in finalizers apply normally.
The installed function is called after all free-running lanes got a chance to terminate (see shutdown_timeout), but before lindas become unusable.
The finalizer receives a single argument, a bool indicating whether all Lanes are successfully terminated at that point. It is possible to inspect them with tracking.
- If there are still running lanes when the finalizer returns: Lanes will throw a C++ std::logic_error if the finalizer returned "throw". Any other value will cause Lanes to freeze forever.
+ If there are still running lanes when the finalizer returns: If the finalizer returned "freeze", Lanes will freeze inside the Universe __gc. Any other value will cause Lanes to raise it as an error. If there is no return value, a default message will be used.
--
cgit v1.2.3-55-g6feb