Re: [RFC] New locking primitive for 2.5

yodaiken
2002-02-07T21:04:04Z

On Thu, Feb 07, 2002 at 12:57:19PM -0800, Andrew Morton wrote:
> yodaiken@fsmlabs.com wrote:
> >
> > llseek:
> > atomic_enquee request
> > if no room gotta sleep
> > else if trylock mutex
> > return
> > else
> > do work
> > loop:
> > process any pending requests
> > release lock;
> > if pending_requests && !(trylock mutex) goto loop
>
> This is how printk() works. It was a very powerful and satisfactory
> solution to a nasty locking/atomicity problem. It'd be nice to have
> a more generic way of expressing that solution.

note how I put in the goto so Ingo would be more happy with it -)

>
> -

--
---------------------------------------------------------
Victor Yodaiken
Finite State Machine Labs: The RTLinux Company.
www.fsmlabs.com www.rtlinux.com