From 68fe13e77b7ceaf950289e747281655ddb264576 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 26 Aug 2002 15:54:20 +0000 Subject: [PATCH] Export functions for explicit locking. --- lib/bucket.c | 6 +++--- lib/bucket.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/bucket.c b/lib/bucket.c index 5e974eb2..5e193407 100644 --- a/lib/bucket.c +++ b/lib/bucket.c @@ -73,19 +73,19 @@ obuck_do_lock(int type) die("fcntl lock: %m"); } -static inline void +inline void obuck_lock_read(void) { obuck_do_lock(F_RDLCK); } -static inline void +inline void obuck_lock_write(void) { obuck_do_lock(F_WRLCK); } -static inline void +inline void obuck_unlock(void) { obuck_do_lock(F_UNLCK); diff --git a/lib/bucket.h b/lib/bucket.h index 80c6f432..24e7ae00 100644 --- a/lib/bucket.h +++ b/lib/bucket.h @@ -42,6 +42,9 @@ struct fastbuf; void obuck_init(int writeable); /* Initialize the bucket module */ void obuck_cleanup(void); /* Clean up the bucket module */ void obuck_sync(void); /* Flush all buffers to disk */ +void obuck_lock_read(void); /* Explicit locking to make sure other threads don't touch buckets now */ +void obuck_lock_write(void); +void obuck_unlock(void); /* Searching for buckets */ void obuck_find_by_oid(struct obuck_header *hdrp); -- 2.39.2