[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Suggested addition to coroutines
- From: Tom Wrensch <twrensch@...>
- Date: Fri, 7 Jun 2002 10:47:30 -0700 (PDT)
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