[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Handling errors of modules
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 18 Nov 2003 08:57:18 -0200
I don't see anything wrong with this. What did you expect? co1 and co2
are running in different Lua threads but they share the registry and the
table of globals. (They don't have to share, but they do by default.)
--lhf
>========================
>local function foo(a)
> errid(a)
> print("set", a)
> coroutine.yield()
> print(errid())
> return
>end
>
>local co1 = coroutine.create(foo)
>local co2 = coroutine.create(foo)
>
>coroutine.resume(co1, 11)
>coroutine.resume(co2, 22)
>
>coroutine.resume(co1)
>coroutine.resume(co2)
>========================
>
>Output:
>set 11
>set 22
>22
>22