]> git.sur5r.net Git - bacula/bacula/commitdiff
Release main control rwlock if ABORTing.
authorKern Sibbald <kern@sibbald.com>
Thu, 3 Jul 2008 15:09:49 +0000 (15:09 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 3 Jul 2008 15:09:49 +0000 (15:09 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7299 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/rwlock.c
bacula/technotes-2.4

index 692f02d2c6b4e40155e8a52a50c64ff2c044aa20..e78216cf68c76c2e9267e25df0b8f93046e1150a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2008 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.
@@ -294,11 +294,13 @@ int rwl_writeunlock(brwlock_t *rwl)
       return stat;
    }
    if (rwl->w_active <= 0) {
-      Emsg0(M_ABORT, 0, _("rwl_writeunlock called too many times.\n"));
+      pthread_mutex_unlock(&rwl->mutex);
+      Jmsg0(NULL, M_ABORT, 0, _("rwl_writeunlock called too many times.\n"));
    }
    rwl->w_active--;
    if (!pthread_equal(pthread_self(), rwl->writer_id)) {
-      Emsg0(M_ABORT, 0, _("rwl_writeunlock by non-owner.\n"));
+      pthread_mutex_unlock(&rwl->mutex);
+      Jmsg0(NULL, M_ABORT, 0, _("rwl_writeunlock by non-owner.\n"));
    }
    if (rwl->w_active > 0) {
       stat = 0;                       /* writers still active */
index c4038e19804ce148d758eda376266ce22f16556f..7f463bb4f1579765573cb01d55f826d3bfd81a2d 100644 (file)
@@ -2,6 +2,7 @@
 
 General:
 03Jul08
+kes  Release main control rwlock if ABORTing.
 kes  Make watchdog connect timeout queue messages rather than sending
      directly to avoid lock conflicts with the real thread.
 kes  Remove const char that causes problems with Python, which has