That's exactly the sense of my question, thanks.
I didn't see in the man page if I should do that sort of cleaning up or
not, it just says that the channel can be freed from either side. so I
wasn't sure in what state alt() is expecting the Alt entries to be at
all time.
I'll try it out later today, thanks.
Cheers,
Mathieu
--- Begin Message ---
On 14 September 2010 09:57, Mathieu Lonjaret <[email protected]> wrote:
> for(;;){
> n = alt(a);
> if(n < 0)
> error("with alt");
>
> if (m[0] == 0){
> // a caller has terminated
> dosomestuff()
shouldn't you nil out the appropriate part of the alt
array here? i.e. a[n].c = nil
otherwise you'll be alting on a freed chan which
must be bad.
--- End Message ---