Skip to content

Commit

Permalink
Corrected an issue in the create function when there is no initial co…
Browse files Browse the repository at this point in the history
…de to be executed by a new Lua process.
  • Loading branch information
Felipe Pina committed Jun 10, 2010
1 parent 6445678 commit 6c5f2de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions alua/alua/thread.lua
Expand Up @@ -118,7 +118,7 @@ function create(code, cb)
]], ALUA_THREAD_REPLY, alua.id, idx)
end

return ccr.spawn(string.format([[
local init_code = [[
require("alua")
alua.id = "%s/%s"
alua.daemonid = %q
Expand All @@ -130,7 +130,13 @@ function create(code, cb)
%s
-- Loop
alua.loop()
]], alua.router, nextid(), alua.daemonid, alua.router, pre, code))
]]

if code then
return ccr.spawn(string.format(init_code, alua.router, nextid(), alua.daemonid, alua.router, pre, code))
else
return ccr.spawn(string.format(init_code, alua.router, nextid(), alua.daemonid, alua.router, pre, ""))
end
end

-----------------------------------------------------------------------------
Expand Down

0 comments on commit 6c5f2de

Please sign in to comment.