summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-11 17:44:09 +0200
committerVolker Lendecke <vl@samba.org>2008-07-11 17:53:25 +0200
commitd670d0a09bec3b6900421df17fc9d959545ee953 (patch)
tree0f772cbe645829c2f92219a04f4fad03cd0a27b4 /source3/lib
parentd803fa6e46c98cc6cdcacfb0225388d786617f0a (diff)
downloadsamba-d670d0a09bec3b6900421df17fc9d959545ee953.tar.gz
samba-d670d0a09bec3b6900421df17fc9d959545ee953.tar.bz2
samba-d670d0a09bec3b6900421df17fc9d959545ee953.zip
Revert "Remove gencache_[un]lock_entry"
This reverts commit 7a5a575ffe5196caecedc93970a25abfbe6f8059. (This used to be commit 62e444dd50ae974c2ab9a553cdf7f188a8f2c538)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/gencache.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index a55b2ab9ba..1b4342a62b 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -484,3 +484,28 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
tdb_search_list_free(first_node);
}
+
+/********************************************************************
+ lock a key
+********************************************************************/
+
+int gencache_lock_entry( const char *key )
+{
+ if (!gencache_init())
+ return -1;
+
+ return tdb_lock_bystring(cache, key);
+}
+
+/********************************************************************
+ unlock a key
+********************************************************************/
+
+void gencache_unlock_entry( const char *key )
+{
+ if (!gencache_init())
+ return;
+
+ tdb_unlock_bystring(cache, key);
+ return;
+}