aboutsummaryrefslogtreecommitdiff
path: root/tests/deadlock.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/deadlock.lua')
-rw-r--r--tests/deadlock.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/deadlock.lua b/tests/deadlock.lua
index c85d99f..c38ca13 100644
--- a/tests/deadlock.lua
+++ b/tests/deadlock.lua
@@ -4,6 +4,11 @@
4local lanes = require('lanes').configure{with_timers=false} 4local lanes = require('lanes').configure{with_timers=false}
5local linda = lanes.linda "deadlock_linda" 5local linda = lanes.linda "deadlock_linda"
6 6
7local SLEEP = function(...)
8 local k, v = lanes.sleep(...)
9 assert(k == nil and v == "timeout")
10end
11
7print "let's begin" 12print "let's begin"
8 13
9local do_extra_stuff = true 14local do_extra_stuff = true
@@ -35,5 +40,5 @@ end
35-- With the bug not fixed, the linda keeper's mutex is still acquired, 40-- With the bug not fixed, the linda keeper's mutex is still acquired,
36-- and the program hangs when the internal linda used for timers attempts to acquire the same keeper (there is only one by default) 41-- and the program hangs when the internal linda used for timers attempts to acquire the same keeper (there is only one by default)
37print('waiting a bit') 42print('waiting a bit')
38lanes.sleep(2) 43SLEEP(2)
39print('we should reach here') \ No newline at end of file 44print('we should reach here') \ No newline at end of file