All fixed. Please see v3.
Anyway, now I seem to understand why you wanted to ignore fiber_cancelin fiber_join - making it cancellable complicates the function protocol,rendering the function barely usable. Guess I was wrong when asked youto rework the patch, sorry. Let's revert to v1. if (child_L != NULL) {
coro_ref = lua_tointeger(child_L, -1);
lua_pop(child_L, 1);
diff --git a/test/app/fiber.result b/test/app/fiber.result
index ab7c1941b..f73d32671 100644
--- a/test/app/fiber.result
+++ b/test/app/fiber.result
@@ -1411,6 +1411,39 @@ l = nil
l1 = nil
---
...
+-- gh-3948 fiber.join() blocks if fiber is cancelled.
+function another_func() fiber.yield() end
+---
+...
+test_run:cmd("setopt delimiter ';'")
+---
+- true
+...
+function func()
+ local fib = fiber.create(another_func)
+ fib:set_joinable(true)
+ fib:join()
+end;
+---
+...
+f = fiber.create(func)
+f:cancel()
+while f:status() ~= 'dead' do fiber.sleep(0.01) end;
AFAICS the test highly depends on the scheduler algorithm. Let's rewriteit using fiber.channel please.+---
+...
+test_run:cmd("setopt delimiter ''");
+---
+- true
+...
+f = nil
+---
+...
+func = nil
+---
+...
+another_func = nil
+---
+...
These assignments aren't necessary.