lkml.org 
[lkml]   [2004]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/4][diskdump] x86-64 support
From
Date
On Tue, 2004-08-31 at 05:10, Takao Indoh wrote:
> >As in the scsi code spin_is_locked checks are bogus and racy. Only
> >a spin_trylock would be safe. hd can't be NULL.
>
> Could you explain to me why spin_is_locked is not safe?
>

Say you have a door with a lock, and someone on the other side. You
look at the lock, see that it's unlocked, then open the door. You
cannot guarantee that the door will open because the person on the other
side could have locked it between the time you looked and turned the
handle.

The only way to know for sure whether the door is locked is to turn the
handle and see if it opens.

Lee

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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