tdb: add TDB_MUTEX_LOCKING support
authorVolker Lendecke <vl@samba.org>
Thu, 21 Feb 2013 15:34:32 +0000 (16:34 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 22 May 2014 19:05:15 +0000 (21:05 +0200)
commit49ee15f7f2289a745b935e290d6de3dfb74a41ed
treef0f403f688faa1231cba29922de56a71d6f4f578
parentd65ec699c82c7d378919d332949cde397db80792
tdb: add TDB_MUTEX_LOCKING support

This adds optional support for locking based on
shared robust mutexes.

The caller can use the TDB_MUTEX_LOCKING flag
together with TDB_CLEAR_IF_FIRST after verifying
with tdb_runtime_check_for_robust_mutexes() that
it's supported by the current system.

The caller should be aware that using TDB_MUTEX_LOCKING
implies some limitations, e.g. it's not possible to
have multiple read chainlocks on a given hash chain
from multiple processes.

Note: that this doesn't make tdb thread safe!

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>