aboutsummaryrefslogtreecommitdiff
path: root/tests/linda_perf.lua
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-06-05 16:03:22 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2025-06-05 16:03:22 +0200
commitbfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8 (patch)
tree00f6633878b21dda6cad1177d5619a501b4ac0a4 /tests/linda_perf.lua
parentf73702bcf4372a149b8b01a512c0e086b1e679e2 (diff)
downloadlanes-bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8.tar.gz
lanes-bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8.tar.bz2
lanes-bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8.zip
Change lane:join() return values
* when no error is raised in the lane, lane:join() now precedes the lane returned values with true * lane body is no longer forced to return something when used with join() * adjusted all relevant unit tests accordingly
Diffstat (limited to 'tests/linda_perf.lua')
-rw-r--r--tests/linda_perf.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/linda_perf.lua b/tests/linda_perf.lua
index 83b8921..e68d552 100644
--- a/tests/linda_perf.lua
+++ b/tests/linda_perf.lua
@@ -56,7 +56,7 @@ local eater = function( l, loop)
56 -- print "loop is over" 56 -- print "loop is over"
57 key, val = l:receive( "done") 57 key, val = l:receive( "done")
58 print("eater: done ("..val..")") 58 print("eater: done ("..val..")")
59 return true 59 return "ate everything"
60end 60end
61 61
62-- ################################################################################################# 62-- #################################################################################################
@@ -74,7 +74,7 @@ local gobbler = function( l, loop, batch)
74 print "loop is over" 74 print "loop is over"
75 key, val = l:receive( "done") 75 key, val = l:receive( "done")
76 print("gobbler: done ("..val..")") 76 print("gobbler: done ("..val..")")
77 return true 77 return "gobbled everything"
78end 78end
79 79
80-- ################################################################################################# 80-- #################################################################################################
@@ -123,7 +123,8 @@ local function ziva1( preloop, loop, batch)
123 end 123 end
124 end 124 end
125 l:send( "done" ,"are you happy?") 125 l:send( "done" ,"are you happy?")
126 lane:join() 126 local r, ret = lane:join()
127 assert(r == true and type(ret) == "string", "got " .. tostring(r) .. " " .. tostring(ret))
127 return lanes.now_secs() - t1 128 return lanes.now_secs() - t1
128end 129end
129 130