Dont try to resume dead threads in the scheduler

This commit is contained in:
Filip Tibell 2023-08-19 18:44:43 -05:00
parent 0757d6f293
commit e4cf40789c

View file

@ -34,6 +34,12 @@ where
let thread_id = thread.id();
let (thread, args) = thread.into_inner(self.lua);
// Make sure this thread is still resumable, it might have
// been resumed somewhere else or even have been cancelled
if thread.status() != LuaThreadStatus::Resumable {
continue;
}
// Resume the thread, ensuring that the schedulers
// current thread id is set correctly for error catching
self.state.set_current_thread_id(Some(thread_id));