Overhaul of thread handling to support blocking functions other than wait
This commit is contained in:
@@ -45,14 +45,15 @@ LuaDefine(global_table, "globalname", "get a table where global data can be stor
|
||||
LuaRet globaltab;
|
||||
LuaVar globaldb;
|
||||
LuaStack LS(L, globalname, globaltab, globaldb);
|
||||
LS.checkstring(globalname);
|
||||
|
||||
// Get a pointer to the globaldb.
|
||||
LS.rawget(globaldb, LuaRegistry, "globaldb");
|
||||
if (!LS.istable(globaldb)) {
|
||||
return lua_yield(L, 0); // donotpredict
|
||||
}
|
||||
|
||||
LS.checkstring(globalname);
|
||||
// nopredict
|
||||
if (lua_isyieldable(L) && (!LS.istable(globaldb))) {
|
||||
return lua_yield(L, 0);
|
||||
}
|
||||
|
||||
// Get the globaltab from the globaldb, sanity check it.
|
||||
LS.rawget(globaltab, globaldb, globalname);
|
||||
|
||||
Reference in New Issue
Block a user