[lkml]   [2001]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: brlock_is_locked()?
On Wed, 22 Aug 2001, Brad Chapman wrote:

> restart:
> if (brlock_is_locked(BR_NETPROTO_LOCK)) {
> br_write_unlock_bh(BR_NETPROTO_LOCK);
> }
> else {
> /* Let's get dizzy */
> br_write_lock_bh(BR_NETPROTO_LOCK);
> goto restart;
> }

That code can never work. None of the linux spinlocks track ownership, so
checking if a lock is locked tells you if your process or another has
ownership of the lock. The above pseudo code is going to result in lots
of mangled data.


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

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