Re: asynchronous libgnomecups implementation



On Fri, 2004-06-18 at 16:39, Jody Goldberg wrote:

> Hmm, the memory management semantics here look inconsistent
> Some of the callback args need to be released by the callback and
> some are freed by the request.

Actually, I think we can't pass the request back to the client ever,
because it will be freed when the operation completes.  I just fixed
that locally.

Normally, the response is expected to be freed by the client.  However,
if the operation was cancelled (or no callback was specified), then we
have to free the response.

> > +gboolean
> > +_gnome_cups_request_is_executing (void)
> > +{
> > +	gboolean ret;
> > +
> > +	g_static_mutex_lock (&request_mutex);
> > +	ret = g_hash_table_size (request_map) > 0;
> > +	g_static_mutex_unlock (&request_mutex);
> > +	return ret;
> > +}
> 
> 1) I don't like this name it could be read as
>     gnome_cups_request::is_executing
> which doesn't match the interface

Actually this is what the function was called before, I just changed the
implementation :)  

But I will change the name in this patch too.

> 2) It would be simpler to say something like
>     gnome_cups_outstanding_requests_count
> and return the size of the queue too.

I agree, will do.

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]