Fix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsha...
commit988fae9d26c62690ce3ecad3316854be6d4297cf
authorJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 18:38:44 +0000 (8 10:38 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 28 Jan 2009 08:39:59 +0000 (28 09:39 +0100)
treeb5a702d704983120c1ea162b5706a1108c31123a
parentb21556530badf62fcf2d9a204a61e429e95b0b14
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.
(cherry picked from commit 0e30f6d835016a73e89e3159d827a2703058d34b)
source/lib/util_tdb.c