From 5750dbabe5db8a1d56b02eba07a4e07aa1836ed2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christophe=20Thi=C3=A9ry?= Date: Thu, 12 Jan 2012 10:23:01 +0100 Subject: [PATCH] Add comments to the Lua task copy callback --- src/bindings/lua/simgrid_lua.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index b2d541aa1a..fa8124ccfb 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -200,7 +200,15 @@ static void task_unregister(lua_State* L, m_task_t task) { /** * \brief This function is called when a C task has just been copied. * - * This callback is used to copy the corresponding Lua task. + * This callback is used to move the corresponding Lua task from the sender + * process to the receiver process. + * It is executed in SIMIX kernel mode when the communication finishes, + * before both processes are awaken. Thus, this function is thread-safe when + * user processes are executed in parallel, though it modifies the Lua + * stack of both processes to move the task. + * After this function, both Lua stacks are restored in their previous state. + * The task is moved from the registry of the sender to the registry of the + * receiver. * * \param task the task copied * \param src_process the sender -- 2.20.1