lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

When I was working on the cooperative scheduler, I ran into a need to be
able to tell when a coroutine was finished executing. What I wanted was
something like this:

    if coroutine.complete(task) then
        removeTask(task)
    else
      ...
    end

What I did instead was wrap the execution in pcall, (which I would do
anyway so an error in one task/thread doesn't kill the scheduler).

  - Tom Wrensch