Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading packages in local directory in threads #68

Open
zck119 opened this issue Jul 28, 2016 · 1 comment
Open

Problem loading packages in local directory in threads #68

zck119 opened this issue Jul 28, 2016 · 1 comment

Comments

@zck119
Copy link

zck119 commented Jul 28, 2016

Hi,

I'm having a problem loading packages from local directory. The problem can be reproduced by the following code:

local init = require 'empty.lua'
local Threads = require 'threads'
Threads.serialization('threads.sharedserialize')

function main()
    require 'empty.lua'
    local function init() 
        require 'empty.lua'
    end 
    t = Threads(1, init)
end 

main()

where empty.lua is a lua package saved in local directory.

Error is only reported for the last require (i.e. the one used in thread initialisation), and loading built-in packages does not generate an error.

Thanks

@alimousazy
Copy link

@zck119 this will work

local init = require 'empty'
local Threads = require 'threads'
Threads.serialization('threads.sharedserialize')

function main()
    require 'empty'
    local function init()
        require 'empty'
    end
    t = Threads(1, init)
end

main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants