In Lua, the stack created by COCOS2DX can only be accessed by one thread (main thread), and if a child thread is established in C + + and then invoked by C + + to invoke the LUA callback function, asynchronous loading will be an error.
If you attempt to load a resource directly through a C + + child thread, return a Boolean value or the number type notifies LUA to implement the callback, the procedure does not display the problem, but the preempted of the C + + sub-line
The memory address of the resource file is not the same as the memory address of the main line loads the source file, although it has already been loaded, the image resource information already exists in the code memory, but the main thread still cannot access the
Resource memory, so the child line preempted's picture new into a sprite is black.
So LUA can not be implemented by asynchronous loading, only through the implementation of the implementation of a similar asynchronous loading effect, that is (loading a little, the progress bar added a bit),
The code address is as follows Link: https://github.com/caolan/async
COCOS2DX 3.x for LUA "Asynchronous load" implementation process