From 7f7b29063d2f19a8bc2b229ae9b0ec82ce447cab Mon Sep 17 00:00:00 2001
From: Benoit Germain
Date: Tue, 13 Aug 2013 08:12:05 +0200
Subject: version 3.6.3
* lane:cancel(
- This document was revised on 20-May-13, and applies to version 3.6.2. + This document was revised on 02-Aug-13, and applies to version 3.6.3.
@@ -292,6 +292,19 @@ +.verbose_errors
+ .protect_allocator
@@ -539,7 +552,7 @@
- cancel()sends a cancellation request to the lane. If timeout_secs is non-zero, waits for the request to be processed, or a timeout to occur.
- Returns true if the lane was already done (in "done", "error" or "cancelled" status) or if the cancellation was fruitful within timeout period.
+ cancel()sends a cancellation request to the lane.
+ If timeout_secs is positive (aka "hard cancel"), waits for the request to be processed, or a timeout to occur.
+ If timeout_secs is negative (aka "soft cancel"), starting with version 3.6.3, will only cause cancel_test() to return true, so that the lane can cleanup manually. You can't provide a second argument in that case.
+ Returns true if soft cancelling, or the lane was already done (in "done", "error" or "cancelled" status), or the cancellation was fruitful within timeout period.
@@ -887,7 +902,7 @@ -- no special error: true error print( " error: "..tostring(err)) elseif type( err) == "userdata" then - -- lane cancellation is performed by throwing a special userdata as error + -- lane cancellation is performed by throwing a special userdata as error print( "after cancel") else -- no error: we just got finalized @@ -977,11 +992,15 @@
- send returns true if the sending succeeded, and false if the queue limit was met, and the queue did not empty enough during the given timeout, or the operation was cancelled. + Hard cancellation will cause pending linda operations to abort execution of the lane through a cancellation error. This means that you have to install a finalizer in your lane if you want to run some code in that situation. +
+ ++ send returns true if the sending succeeded, and false if the queue limit was met, and the queue did not empty enough during the given timeout.
- Equally, receive returns a key and the value extracted from it, or nothing for timeout or cancellation. Note that nils can be sent and received; the key value will tell it apart from a timeout.
+ Equally, receive returns a key and the value extracted from it, or nothing for timeout. Note that nils can be sent and received; the key value will tell it apart from a timeout.
Version 3.4.0 introduces an API change in the returned values: receive returns the key followed by the value(s), in that order, and not the other way around.