Re: cbdata

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Thu, 12 Jul 2001 21:27:55 -0600 (MDT)

On Thu, 12 Jul 2001, Henrik Nordstrom wrote:

> Alex Rousskov wrote:
>
> > My understanding is that it may become invalid. Thus, the callback
> > must call cbdataValid() before accessing the pointer. I think Henrik
> > is just trying to avoid calling the callback if the data is already
> > invalid (and decrement reference count at the same time).
>
> The callback does not need to call cbdataValid() before accessing the
> pointer because it per definition owns the object, but the one calling
> the callback MUST before making the callback.

Ah, yes. I forgot about this asymmetry. Not sure it is the best design
(a simple refcounted pointer with an "invalidate" method seems more
natural/general to me), but you certainly know better what Squid code
needs.
 
Thanks for the explanation,

Alex.
Received on Thu Jul 12 2001 - 21:27:58 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:07 MST