Re: [PATCH] apm-emulation: Fix mutex race condition

Rafael J. Wysocki
2011-05-03T20:33:51Z

On Tuesday, May 03, 2011, Paul Parsons wrote:
> Hi Rafael,
>
> --- On Tue, 3/5/11, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > Hmm. I'd rather use mutex_trylock() and call try_to_freeze() if
> > that fails.
> >
> > Is there anything wrong with this approach?
>
> Well, mutex_trylock() doesn't wait if it cannot acquire the mutex, so won't the calling process enter a busy loop if it fails?

Right. So I don't see how we could do better that in your patch at the
moment.

I'm not sure if Jiri is going to take your patch. I will if he doesn't.

Thanks,
Rafael