Re: [RFC] New locking primitive for 2.5

yodaiken
2002-02-08T15:14:43Z

On Fri, Feb 08, 2002 at 10:47:24AM -0200, Denis Vlasenko wrote:
> On 7 February 2002 17:56, yodaiken@fsmlabs.com wrote:
> > > If a spin_lock request is blocked by a mutex_lock call, the spin_lock
> > > attempt also sleeps i.e. behaves like a semaphore.
> >
> > So what's the difference between combi_spin and combi_mutex?
> > combi_spin becomes
> > if not mutex locked, spin
> > else sleep
> > Bizzare
>
> combi_spin_lock():
> If not mutex locked, spin - will be released shortly
> else sleep - may take long time before released
> * lock released *
> spin lock it! <=== this is the difference -
> combi_mutex_lock would mutex lock it here
>
> What's wrong with this?

In the elegant words of Andrew Morton, this is a "I don't know what
the fuck I'm doing lock".

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