Re: [PATCH 01/13] PM: Add wake lock api.

Arve Hjønnevåg
2009-02-11T02:11:59Z

On Tue, Feb 10, 2009 at 12:25 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Wakelock is really bad name: it is not a lock and it does not protect
> wake. I'd say we need better name here.

It is similar to a reader/writer lock, and it does protect the wake
state. The writer, the suspend code, blocks until all the readers
release their lock. If there are no readers after suspending all the
drivers, the wake state changes. Since the readers can only run when
in the awake state, they never block.

--
Arve Hjønnevåg