From c38429579de57d338e0a1c14a7ed7b4aa90e059a Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 10 Feb 2014 17:18:14 +0100 Subject: new API linda:cancel("read"|"write"|"both"|"none") * bumped version to 3.8.4 * all linda operations return lanes.cancel_error on a cancelled linda * raised an internal string length so that longer linda names are fully output before truncation applies when doing tostring( linda) --- tests/cancel.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/cancel.lua b/tests/cancel.lua index 0aab341..a5f1dab 100644 --- a/tests/cancel.lua +++ b/tests/cancel.lua @@ -83,11 +83,26 @@ h = lanes.gen("*", laneBody)() print "wait 3s" linda:receive( 3, "yeah") --- hard cancel and wait 10s: the lane will be interrupted from inside its current linda:receive() and won't return from it +-- hard cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it print "hard cancel (always awakens)" h:cancel() print "wait 5s" linda:receive( 5, "yeah") -print "\ndone" \ No newline at end of file +--#################################################################### +print "\n\n####################################################################\nbegin linda cancel test\n" +h = lanes.gen("*", laneBody)() + +-- wait 3s before cancelling the lane +print "wait 3s" +linda:receive( 3, "yeah") + +-- linda cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it +print "linda cancel (always awakens the lane)" +linda:cancel( "both") + +print "wait 5s" +linda:receive( 5, "yeah") + +print "\ndone" -- cgit v1.2.3-55-g6feb