From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d0728b52f51f685e X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: copy constructor for sockets Date: 25 May 2004 05:53:14 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1085461070 1120 62.49.19.209 (25 May 2004 04:57:50 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 25 May 2004 04:57:50 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: controlnews3.google.com comp.lang.ada:809 Date: 2004-05-25T05:53:14+01:00 List-Id: tmoran@acm.org writes: > >I have it stuck in my head that Finalize can get called more than > >once. Which would make a mockery of (simple-minded) reference counting > If each copy of the socket points to the single shared ref count > (Rep_Type here), then Finalize may be called as often as you want on the > socket: the first time it's called it decrements the shared reference > count, frees the Rep_Type if the count is now zero, and nulls the socket's > pointer. Subsequent calls on the same socket see that the pointer is null > and there's nothing to do. Of course, thanks Tom & Matt!