fix an issue that delay is not applied to tasks pushed to luajit context

This commit is contained in:
falsycat 2023-08-06 17:02:05 +09:00
parent b2928ae25f
commit 3a3adbcde6

View File

@ -82,6 +82,7 @@ class ContextImpl final :
void Push(Task&& task) noexcept override {
auto self = std::dynamic_pointer_cast<ContextImpl<T>>(shared_from_this());
tasq_->Push(typename T::Item {
task.after(),
[self, task = std::move(task)](auto&) mutable {
TaskContext ctx {self, self->state()};
lua_settop(*ctx, 0);