On Fri, May 28, 2010 at 9:31 AM, Alan Cox <email@example.com> wrote:
This is the same as saying these two threads don't run often enough to
need a mutex around their critical section. Just because you have not
been bitten by the race yet, does not mean it does not exist.
If each layer prevents suspend while it knows there are pending events
you don't have a race. Suspend blockers lets you do this.
Yes you can do this, and it it how the android alarm driver works, but
we found the select()/poll(), block suspend, read event, process event
then unblock suspend sequence cleaner (especially for interfaces that
can return more than one event at a time). Kernel suspend blocker lets
you implement the alarm driver model, adding user-space suspend
blockers lets you implement the second.