From: Martin Mares Date: Mon, 26 Aug 2002 15:54:20 +0000 (+0000) Subject: Export functions for explicit locking. X-Git-Tag: holmes-import~1354 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=68fe13e77b7ceaf950289e747281655ddb264576;p=libucw.git Export functions for explicit locking. --- 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);