From 4f97720e4c3944ccf9b9742028dc697c2dd94c5a Mon Sep 17 00:00:00 2001
From: Benoit Germain
- This document was revised on 29-Sep-2025, and applies to version 4.0.0.
+ This document was revised on 26-Feb-2026, and applies to version 4.0.0.
- Copyright © 2007-25 Asko Kauppi, Benoit Germain. All rights reserved.
+ Copyright © 2007-26 Asko Kauppi, Benoit Germain. All rights reserved.
Lua Lanes is published under the same MIT license as Lua 5.1, 5.2, 5.3, 5.4 and 5.5.
- If the lane isn't actually waiting on a linda when the request is issued, a lane calling cancel_test() will see it return "hard".
+ If the lane isn't actually waiting on a linda when the request is issued, a lane calling cancel_test() will also raise lanes.cancel_error, unless cancel_test(true) is used, in which case it returns "hard" instead.
- wake_lane defaults to true, and timeout defaults to 0 if not specified.
+ wake_lane defaults to true, and timeout defaults to infinite if not specified.
- If the lane has the opportunity to call cancel_test() before the hook is invoked, calling cancel_test() will see it return "hard".
+ If the lane has the opportunity to call cancel_test() before the hook is invoked, it will also raise lanes.cancel_error (or return "hard" if cancel_test(true) is used).
- false|"soft"|"hard" = cancel_test() -- inside the lane + false|"soft" = cancel_test() -- raises cancel_error on hard cancel + false|"soft"|"hard" = cancel_test(true) -- returns "hard" instead of raising |
Lanes installs the function cancel_test() in each created lane to manually test for cancel requests. + It returns false when no cancel is pending, "soft" on a soft cancel request, and raises + lanes.cancel_error on a hard cancel request. Passing true as the optional argument suppresses + the raise and returns "hard" instead, which is useful when the lane needs to distinguish the cancel + mode before deciding how to react.
-- cgit v1.2.3-55-g6feb