summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap/dbwrap_private.h
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-01-08 19:04:39 +0100
committerVolker Lendecke <vlendec@samba.org>2012-01-18 14:48:04 +0100
commit333c92384b0680b8f8e5198dd68d49b249b34ec7 (patch)
tree8042feeb87bf2a0f763b0972facca268a935a8c6 /source3/lib/dbwrap/dbwrap_private.h
parent45e61fcf61ed9863fbe2b116fe0763fc139bbe0d (diff)
downloadsamba-333c92384b0680b8f8e5198dd68d49b249b34ec7.tar.gz
samba-333c92384b0680b8f8e5198dd68d49b249b34ec7.tar.bz2
samba-333c92384b0680b8f8e5198dd68d49b249b34ec7.zip
s3: Enforce a lock order in dbwrap
This makes sure we do not deadlock from doing two dbwrap_fetch_locked in two processes in different orders. At open time, we assign a strict order to all databases. lock_order 1 will be locked first, lock_order 2 second. No two records of the same lock order may be locked at the same time.
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_private.h')
-rw-r--r--source3/lib/dbwrap/dbwrap_private.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h
index d0b3279368..111f02dc6b 100644
--- a/source3/lib/dbwrap/dbwrap_private.h
+++ b/source3/lib/dbwrap/dbwrap_private.h
@@ -56,6 +56,7 @@ struct db_context {
int (*exists)(struct db_context *db,TDB_DATA key);
int (*wipe)(struct db_context *db);
void *private_data;
+ enum dbwrap_lock_order lock_order;
bool persistent;
};