From a1685c3ef70bc70fcb7b8fde4a2a2e9f6d8e11f0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 1 Oct 2013 23:36:57 -0700 Subject: [PATCH] More doc for MDB_NORDLOCK --- libraries/liblmdb/lmdb.h | 9 +++++++-- libraries/liblmdb/mdb.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 848ba635dd..968862f987 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -265,11 +265,11 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel #define MDB_NOMETASYNC 0x40000 /** use writable mmap */ #define MDB_WRITEMAP 0x80000 - /** use asynchronous msync when MDB_WRITEMAP is used */ + /** use asynchronous msync when #MDB_WRITEMAP is used */ #define MDB_MAPASYNC 0x100000 /** tie reader locktable slots to #MDB_txn objects instead of to threads */ #define MDB_NOTLS 0x200000 - /** don't use reader locktable at all, caller must manage read/write concurrency */ + /** for #MDB_RDONLY env, don't use reader locktable, caller must manage read/write concurrency */ #define MDB_NORDLOCK 0x400000 /** @} */ @@ -527,6 +527,11 @@ int mdb_env_create(MDB_env **env); * user threads over individual OS threads need this option. Such an * application must also serialize the write transactions in an OS * thread, since MDB's write locking is unaware of the user threads. + *
  • #MDB_NORDLOCK + * Don't use the reader locktable at all. This flag is only valid + * with #MDB_RDONLY. MDB will use no read locks. If other processes + * may be opening the environment with write access, the callers + * must manage read/write locks themselves. * * @param[in] mode The UNIX permissions to set on created files. This parameter * is ignored on Windows. diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index e82335d716..637cd08809 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3900,7 +3900,7 @@ fail: * environment and re-opening it with the new flags. */ #define CHANGEABLE (MDB_NOSYNC|MDB_NOMETASYNC|MDB_MAPASYNC) -#define CHANGELESS (MDB_FIXEDMAP|MDB_NOSUBDIR|MDB_RDONLY|MDB_WRITEMAP|MDB_NOTLS) +#define CHANGELESS (MDB_FIXEDMAP|MDB_NOSUBDIR|MDB_RDONLY|MDB_WRITEMAP|MDB_NOTLS|MDB_NORDLOCK) int mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode) -- 2.39.5