Skip to content
Snippets Groups Projects
Commit 0ff9e09c authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix #536: fiber.info() doesn't list fibers with default names

parent 26771d2d
No related branches found
No related tags found
No related merge requests found
......@@ -220,9 +220,13 @@ lbox_fiber_statof(struct fiber *f, void *cb_ctx)
{
struct lua_State *L = (struct lua_State *) cb_ctx;
lua_pushstring(L, fiber_name(f));
lua_pushinteger(L, f->fid);
lua_newtable(L);
lua_pushliteral(L, "name");
lua_pushstring(L, fiber_name(f));
lua_settable(L, -3);
lua_pushstring(L, "fid");
lua_pushnumber(L, f->fid);
lua_settable(L, -3);
......
......@@ -726,6 +726,44 @@ done
---
- true
...
-- # gh-536: fiber.info() doesn't list fibers with default names
--
function loop() while true do fiber.sleep(10) end end
---
...
f1 = fiber.create(loop)
---
...
f2 = fiber.create(loop)
---
...
f3 = fiber.create(loop)
---
...
info = fiber.info()
---
...
info[f1:id()] ~= nil
---
- true
...
info[f2:id()] ~= nil
---
- true
...
info[f3:id()] ~= nil
---
- true
...
f1:cancel()
---
...
f2:cancel()
---
...
f3:cancel()
---
...
fiber = nil
---
...
......@@ -296,4 +296,20 @@ end;
f = fiber.create(test)
done
-- # gh-536: fiber.info() doesn't list fibers with default names
--
function loop() while true do fiber.sleep(10) end end
f1 = fiber.create(loop)
f2 = fiber.create(loop)
f3 = fiber.create(loop)
info = fiber.info()
info[f1:id()] ~= nil
info[f2:id()] ~= nil
info[f3:id()] ~= nil
f1:cancel()
f2:cancel()
f3:cancel()
fiber = nil
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment