diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-02-10 17:18:14 +0100 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-02-10 17:18:14 +0100 |
commit | c38429579de57d338e0a1c14a7ed7b4aa90e059a (patch) | |
tree | 8b2a1f38ba71dba44af491d8449eace5f261cbbe /tests | |
parent | 5cf4979c3ee7052bbb363bf75463fb861e6ac1e5 (diff) | |
download | lanes-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.lua | 19 |
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)() | |||
83 | print "wait 3s" | 83 | print "wait 3s" |
84 | linda:receive( 3, "yeah") | 84 | linda: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 |
87 | print "hard cancel (always awakens)" | 87 | print "hard cancel (always awakens)" |
88 | h:cancel() | 88 | h:cancel() |
89 | 89 | ||
90 | print "wait 5s" | 90 | print "wait 5s" |
91 | linda:receive( 5, "yeah") | 91 | linda:receive( 5, "yeah") |
92 | 92 | ||
93 | print "\ndone" \ No newline at end of file | 93 | --#################################################################### |
94 | print "\n\n####################################################################\nbegin linda cancel test\n" | ||
95 | h = lanes.gen("*", laneBody)() | ||
96 | |||
97 | -- wait 3s before cancelling the lane | ||
98 | print "wait 3s" | ||
99 | linda:receive( 3, "yeah") | ||
100 | |||
101 | -- linda cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it | ||
102 | print "linda cancel (always awakens the lane)" | ||
103 | linda:cancel( "both") | ||
104 | |||
105 | print "wait 5s" | ||
106 | linda:receive( 5, "yeah") | ||
107 | |||
108 | print "\ndone" | ||