diff --git a/tests/test_join_gc.lua b/tests/test_join_gc.lua new file mode 100644 index 0000000..39cd7e4 --- /dev/null +++ b/tests/test_join_gc.lua @@ -0,0 +1,16 @@ +local llthreads = require "llthreads" + +local CODE=[[ +local function gc(fn) + local p = assert(newproxy()) + assert(debug.setmetatable(p, { __gc = fn })) + return p +end + +p = gc(function() print("hello from gc") end) +]] + +local thread = llthreads.new(CODE) +thread:start() +thread:join() +