[patch] Make APM and PMU poll like acpi does

Richard Hughes richard at hughsie.com
Sat Mar 19 13:19:30 PST 2005


On Tue, 2005-03-08 at 11:28 +0100, Sjoerd Simons wrote:
> On Mon, Mar 07, 2005 at 11:37:24AM -0500, David Zeuthen wrote:
> > On Mon, 2005-03-07 at 11:28 +0100, Sjoerd Simons wrote:
> > >Why are you using one poll function that searches the complete gdl for the
> > >right objects each time ? Just adding a timeout for each object when it's added 
> > >and removing that when the object is removed seems cleaner to me.
> > 
> > Then you can get into all sorts of interesting races if the HalDevice
> > object is removed (which is probably never is for PMU but you get the
> > point). It's also more code and more accounting. 
> 
> It's actually less code. But the problem is a hal device currently doesn't have
> a removed signal. If it would have that then the following pseudo code would 
> be enough: 
> 
> id = g_timeout_add(PMU_TIMEOUT, pmu_rescan, device);
> g_signal_connect(device, "removed", device_remove_timeout, GOINT_TO_POINTER(id))
> 
> Where device_remove_timeout just does g_source_remove with the passed id.
> 
> > Something to optimize for later I guess unless you got a patch handy?
> 
> No sorry.. I'm currently swamped, hopefully i'll have the time to starting
> playing with stuff again after my exams..

Could I have the original patch applied for the mean-time then? Then I
can continue with my work on GNOME Power Manager. We can always change
it later. It's just at the moment only ACPI values update themselves. 

Comments?

Richard.


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



More information about the Hal mailing list