Fix race condition in alarm lock processing noticed by Richard Sharpe <realrichardsha...
commit8904b83ce6c69db31dc2ce4c05e8e8ee3db5ec3b
authorJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 18:56:36 +0000 (8 10:56 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 18:56:36 +0000 (8 10:56 -0800)
treeb207343094b262cc747b2e17d7ba648757cc4c31
parent3ee41667d7bb8358c80af24f78dbdd071fa9c765
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