diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb/common/lock.c | 7 | ||||
-rw-r--r-- | lib/tdb/include/tdb.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c index 6644c4034e0..195dbb5daf2 100644 --- a/lib/tdb/common/lock.c +++ b/lib/tdb/common/lock.c @@ -858,6 +858,13 @@ _PUBLIC_ int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key) return tdb_unlock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK); } +_PUBLIC_ int tdb_chainlock_read_nonblock(struct tdb_context *tdb, TDB_DATA key) +{ + int ret = tdb_lock_nonblock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK); + tdb_trace_1rec_ret(tdb, "tdb_chainlock_read_nonblock", key, ret); + return ret; +} + /* record lock stops delete underneath */ int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off) { diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index 03e429cc8a8..8478ca20d7b 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -884,6 +884,7 @@ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key); int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key); int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key); int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key); +int tdb_chainlock_read_nonblock(struct tdb_context *tdb, TDB_DATA key); int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key); int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key); int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key); |