Overhaul of thread handling to support blocking functions other than wait
This commit is contained in:
@@ -328,9 +328,10 @@ static eng::string source_load_lfunctions(lua_State *L) {
|
||||
|
||||
// Call the closure. If there's an error, collect it.
|
||||
lua_pushvalue(L, closure.index());
|
||||
if (traceback_pcall(L, 0, 0) != 0) {
|
||||
lua_replace(L, err.index());
|
||||
errss << LS.ckstring(err);
|
||||
eng::string msg = traceback_pcall(L, 0, 0);
|
||||
if (!msg.empty()) {
|
||||
LS.set(err, msg);
|
||||
errss << msg << std::endl;
|
||||
}
|
||||
}
|
||||
LS.result();
|
||||
@@ -380,9 +381,10 @@ void SourceDB::run_unittests() {
|
||||
LS.rawget(func, unittests, name);
|
||||
|
||||
lua_pushvalue(L, func.index());
|
||||
if (traceback_pcall(L, 0, 0) != 0) {
|
||||
lua_replace(L, err.index());
|
||||
std::cerr << LS.ckstring(err);
|
||||
eng::string msg = traceback_pcall(L, 0, 0);
|
||||
if (!msg.empty()) {
|
||||
LS.set(err, msg);
|
||||
std::cerr << msg << std::endl;
|
||||
any = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user