aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <bnt period germain arrobase gmail period com>2014-02-10 17:18:14 +0100
committerBenoit Germain <bnt period germain arrobase gmail period com>2014-02-10 17:18:14 +0100
commitc38429579de57d338e0a1c14a7ed7b4aa90e059a (patch)
tree8b2a1f38ba71dba44af491d8449eace5f261cbbe /tests
parent5cf4979c3ee7052bbb363bf75463fb861e6ac1e5 (diff)
downloadlanes-c38429579de57d338e0a1c14a7ed7b4aa90e059a.tar.gz
lanes-c38429579de57d338e0a1c14a7ed7b4aa90e059a.tar.bz2
lanes-c38429579de57d338e0a1c14a7ed7b4aa90e059a.zip
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)
Diffstat (limited to 'tests')
-rw-r--r--tests/cancel.lua19
1 files changed, 17 insertions, 2 deletions
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)()
83print "wait 3s" 83print "wait 3s"
84linda:receive( 3, "yeah") 84linda:receive( 3, "yeah")
85 85
86-- hard cancel and wait 10s: the lane will be interrupted from inside its current linda:receive() and won't return from it 86-- hard cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it
87print "hard cancel (always awakens)" 87print "hard cancel (always awakens)"
88h:cancel() 88h:cancel()
89 89
90print "wait 5s" 90print "wait 5s"
91linda:receive( 5, "yeah") 91linda:receive( 5, "yeah")
92 92
93print "\ndone" \ No newline at end of file 93--####################################################################
94print "\n\n####################################################################\nbegin linda cancel test\n"
95h = lanes.gen("*", laneBody)()
96
97-- wait 3s before cancelling the lane
98print "wait 3s"
99linda:receive( 3, "yeah")
100
101-- linda cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it
102print "linda cancel (always awakens the lane)"
103linda:cancel( "both")
104
105print "wait 5s"
106linda:receive( 5, "yeah")
107
108print "\ndone"