]> git.ozlabs.org Git - ccan/commit
tdb: don't suppress the transaction lock because of the allrecord lock.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Feb 2010 03:03:53 +0000 (13:33 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Feb 2010 03:03:53 +0000 (13:33 +1030)
commit57c618f35d2aa244d444670c63a21e7a677c63c2
tree236232f9e4bb7b7732a26f1ef2ca075ecfd26246
parentacf1a21e440b2908df0ce57c48dab1aca9e23cad
tdb: don't suppress the transaction lock because of the allrecord lock.

tdb_transaction_lock() and tdb_transaction_unlock() do nothing if we
hold the allrecord lock.  However, the two locks don't overlap, so
this is wrong.

This simplification makes the transaction lock a straight-forward nested
lock.

There are two callers for these functions:
1) The transaction code, which already makes sure the allrecord_lock
   isn't held.
2) The traverse code, which wants to stop transactions whether it has the
   allrecord lock or not.  There have been deadlocks here before, however
   this should not bring them back (I hope!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/tdb/lock.c