Fix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsha...
authorJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 18:34:23 +0000 (10:34 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 18:34:23 +0000 (10:34 -0800)
commit92c251ace583391ea1540f0ae455399f8a75cecf
tree555cfa6a5df993fcd950a0b390e10c654c383d10
parentc5a8337657ebe63e1c12279fcec20a6a1abd8638
Fix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsharpe@gmail.com>.
"It seems to me that if the lock is already held by another process when we
enter this code, there is a race between the timeout and the granting. If
the lock is subsequently granted, the process releasing the lock will signal
the wait variable (or whatever) and our process will be scheduled. However,
if the timeout occurs before we are scheduled, the timeout will be delivered
first.

We will have the lock but will forget we have the lock, and never release
it."
Jeremy.
source/lib/util_tdb.c