diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-11 11:36:15 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-11 11:36:15 +0200 |
commit | 84294d0b5462d0a05fb5d53df5a64f7ee624a726 (patch) | |
tree | 16b79e505db565c5712b442cdfb3f3bb15be7884 /tests/fifo.lua | |
parent | 17f98b33ed26338094a08d25e9fbf25b71c58f16 (diff) | |
download | lanes-84294d0b5462d0a05fb5d53df5a64f7ee624a726.tar.gz lanes-84294d0b5462d0a05fb5d53df5a64f7ee624a726.tar.bz2 lanes-84294d0b5462d0a05fb5d53df5a64f7ee624a726.zip |
Fixes and improvements to lane:join()
* fix: returns nil,cancel_error when lane was cancelled
* improvement: enforce non-nil first return value of lane body when using lane:join() to obtain the results
Diffstat (limited to 'tests/fifo.lua')
-rw-r--r-- | tests/fifo.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/fifo.lua b/tests/fifo.lua index d741931..e1bfeae 100644 --- a/tests/fifo.lua +++ b/tests/fifo.lua | |||
@@ -82,4 +82,6 @@ print( B:receive( 2.0)) | |||
82 | -- by multiple threads (other parts will be copied but the 'linda' | 82 | -- by multiple threads (other parts will be copied but the 'linda' |
83 | -- handle is shared userdata and will thus point to the single place) | 83 | -- handle is shared userdata and will thus point to the single place) |
84 | lanes.timer_lane:cancel() -- hard cancel, 0 timeout | 84 | lanes.timer_lane:cancel() -- hard cancel, 0 timeout |
85 | lanes.timer_lane:join() \ No newline at end of file | 85 | local status, err = lanes.timer_lane:join() |
86 | assert(status == nil and err == lanes.cancel_error, "status="..tostring(status).." err="..tostring(err)) | ||
87 | print "TEST OK" | ||