From 5cbe60ecbab7236cbc23e9ec3e9d57994101739c Mon Sep 17 00:00:00 2001 From: Georgy Moshkin Date: Fri, 29 Oct 2021 18:04:17 +0300 Subject: [PATCH] chore(fiber): add comment explaining the situation --- tarantool/src/fiber.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tarantool/src/fiber.rs b/tarantool/src/fiber.rs index e68162f6..1b094381 100644 --- a/tarantool/src/fiber.rs +++ b/tarantool/src/fiber.rs @@ -418,6 +418,11 @@ pub struct LuaFiber { callee: C, } +/// Deferred non-yielding fiber implemented using **lua** api. This (hopefully) +/// temporary implementation is a workaround. Tarantool C API lacks the method +/// for passing the necessary information into the underlying `struct fiber` +/// reliably. In this case we need to be able to set the `void *f_arg` field to +/// be able to implement correct deferred fibers which don't yield. impl LuaFiber where C: LuaCallee, @@ -431,7 +436,6 @@ where let Self { callee } = self; let fiber_ref = unsafe { let l = ffi::luaT_state(); - // TODO don't require("fiber") everytime lua::lua_getglobal(l, c_ptr!("require")); lua::lua_pushstring(l, c_ptr!("fiber")); if lua::lua_pcall(l, 1, 1, 0) == lua::LUA_ERRRUN {