[lkml]   [2000]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: *_trylock return on success?
On Sat, 25 Nov 2000, Roger Larsson wrote:

> Questions:
> What are _trylocks supposed to return?

It depends on the type of _trylock ;(

> Does spin_trylock and down_trylock behave differently?
> Why isn't the expected return value documented?

The whole trylock stuff is, IMHO, a big mess. When you
change from one type of trylock to another, you may be
forced to invert the logic of your code since the return
code from the different locks is different.

For bitflags, for example, the trylock returns the state
the bit had before the lock (ie. 1 if the thing was already

For spinlocks, it'll probably return something else ;/


Hollywood goes for world dumbination,
Trailer at 11.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:47    [W:0.059 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site