[patch] asynchronous callouts

Joe Shaw joe at ximian.com
Mon Apr 26 13:12:08 PDT 2004


> Eh, it didn't work with hal-device-manager. 

What happened?  Traceback?  It worked ok here.

> But with the patch the UDI is assigned before callout (it has to) and
> now there's a delay, due to callouts so all devices get the same UDI.
> Which break things. But I've cooked up a patch so we also search the tdl
> and then it works - it should apply on top of your patch. You can find
> it attached. I'm not complete sure of the refcount issues though, please
> review.

Refcount looks fine.  The ref/unref we do should protect us from a
premature finalization.

> The patch also got a hal_device_store_print () utility. It would be nice
> if you can add ChangeLog entries for this.

Yep, and the rest, of course.

> Apart from that the only comment I have is that would be nice to replace
> this
> 
> +                       g_signal_connect (g_object_ref (device_to_add),
> +                                         "callouts_finished",
> +                                         G_CALLBACK (add_to_gdl),
> NULL);
> +
> 
> with a call to something along the lines of the prototype of
> hal_device_store_match_key_value_string_async (perhaps without a
> timeout).

I kept the signal connection there as-is, but I moved the add_to_gdl()
from bus_device.c and class_device.c (which were identical) into
common.c.  It didn't seem to make sense to me to abstract it out as long
as it's pretty straightforward.

> And we need some async delay for when removing devices, but I suppose
> this can wait a bit.

To protect removing and then immediately reinserting the same device?
We'll need some way to detect that. :)

Anyway, the patch with yours on top are committed.

Thanks,
Joe


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list