]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/rwlock.h
Tweak version date
[bacula/bacula] / bacula / src / lib / rwlock.h
index 7c5847636d9f09c83b652c5ee998f72acc4e7d8b..c07e5c68755b357c1de3f267d38e1b82f41d5b5c 100644 (file)
@@ -1,24 +1,12 @@
-/*
- * Bacula Thread Read/Write locking code. It permits
- *  multiple readers but only one writer.
- *
- *  Kern Sibbald, January MMI
- *
- *  This code adapted from "Programming with POSIX Threads", by
- *    David R. Butenhof
- *
- *   Version $Id$
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -27,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ * Bacula Thread Read/Write locking code. It permits
+ *  multiple readers but only one writer.
+ *
+ *  Kern Sibbald, January MMI
+ *
+ *  This code adapted from "Programming with POSIX Threads", by
+ *    David R. Butenhof
+ *
+ *   Version $Id$
+ *
+ */
 
 #ifndef __RWLOCK_H
 #define __RWLOCK_H 1
@@ -66,6 +66,8 @@ typedef struct s_rwsteal_tag {
    {PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, \
     PTHREAD_COND_INITIALIZER, RWLOCK_VALID, 0, 0, 0, 0}
 
+#define rwl_writelock(x)     rwl_writelock_p((x), __FILE__, __LINE__)
+
 /*
  * read/write lock prototypes
  */
@@ -74,7 +76,8 @@ extern int rwl_destroy(brwlock_t *rwlock);
 extern int rwl_readlock(brwlock_t *rwlock);
 extern int rwl_readtrylock(brwlock_t *rwlock);
 extern int rwl_readunlock(brwlock_t *rwlock);
-extern int rwl_writelock(brwlock_t *rwlock);
+extern int rwl_writelock_p(brwlock_t *rwlock,
+                           const char *file="*unknown*", int line=0);
 extern int rwl_writetrylock(brwlock_t *rwlock);
 extern int rwl_writeunlock(brwlock_t *rwlock);