9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Mathieu Lonjaret" <mathieu.lonjaret@gmail.com>
To: 9fans@9fans.net
Subject: Re: [9fans] alt and chanfree
Date: Tue, 14 Sep 2010 12:04:30 +0200	[thread overview]
Message-ID: <ae50545f10f809a845590d4a3d2c81ea@iram.fr> (raw)
In-Reply-To: <AANLkTinXHZ_QbM+CbWwJ_j-t-HY5RtK8Fbwf-i8R+rgr@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

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

[-- Attachment #2: Type: message/rfc822, Size: 5342 bytes --]

From: roger peppe <rogpeppe@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] alt and chanfree
Date: Tue, 14 Sep 2010 10:55:55 +0100
Message-ID: <AANLkTinXHZ_QbM+CbWwJ_j-t-HY5RtK8Fbwf-i8R+rgr@mail.gmail.com>

On 14 September 2010 09:57, Mathieu Lonjaret <mathieu.lonjaret@gmail.com> 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.

  reply	other threads:[~2010-09-14 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14  8:57 Mathieu Lonjaret
2010-09-14  9:55 ` roger peppe
2010-09-14 10:04   ` Mathieu Lonjaret [this message]
2010-09-14 13:01     ` erik quanstrom
2010-09-14 13:27       ` Mathieu Lonjaret
2010-09-14 13:30         ` erik quanstrom
2010-09-14 13:46           ` Mathieu Lonjaret
2010-09-14 13:49         ` Gorka Guardiola
2010-09-14 14:17           ` erik quanstrom
2010-09-15  8:15             ` Mathieu Lonjaret
2010-09-15  9:47               ` roger peppe
2010-09-15 11:07                 ` Mathieu Lonjaret

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae50545f10f809a845590d4a3d2c81ea@iram.fr \
    --to=mathieu.lonjaret@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).