[Patch] Make addon-pmu work blocking

Sjoerd Simons sjoerd at luon.net
Sun Feb 19 08:27:38 PST 2006


On Sat, Feb 18, 2006 at 07:02:32PM +0000, Richard Hughes wrote:
> On Fri, 2006-02-17 at 20:32 +0100, Sjoerd Simons wrote:
> > Hi,
> > 
> >   Attached patch makes the addon-pmu work in blocking mode (thus open
> >   /dev/adb blocking). I've been running a little daemon on my system for
> >   some years that also does this without any problems, so it should be fine
> >   and makes the code somewhat nice imho. I've also removed some old dead
> >   code, don't think there is much use in keeping it around right ? 
> 
> What advantage is blocking? 

It makes the code simpler. What the code now did was write, wait a while, try a
read, if that fails wait somewhat and try again etc. 

When using blocking mode you just do a read and it will return if the data
arravives, no more trial and error, much more elegant.

> Also, if this is blocking PMU, will hal-system-power-pmu still work to put
> the machine to sleep and get it's brightness values?

Blocking means that the read call only returns when there is data available.
It's got nothing todo with blocking the PMU :) 

  Sjoerd
-- 
Life exists for no known purpose.


More information about the hal mailing list