]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/lock.c
First go at supporting a mount and unmount wrapper for tape devices. Initial cleanup...
[bacula/bacula] / bacula / src / stored / lock.c
index a1e7aa69b60261619867d4063327480d94c9e7fd..392eab47a148a7a40f91c5f2fe6ffab790c7ddf1 100644 (file)
@@ -206,17 +206,19 @@ void DEVICE::_r_dunlock(const char *file, int line)
  * and preparing the label.
  */
 #ifdef SD_DEBUG_LOCK
-void DEVICE::_r_dlock(const char *file, int line)
+void DEVICE::_r_dlock(const char *file, int line, bool locked)
 {
    Dmsg3(sd_dbglvl+1, "r_dlock blked=%s from %s:%d\n", this->print_blocked(),
          file, line);
 #else
-void DEVICE::r_dlock()
+void DEVICE::r_dlock(bool locked)
 {
 #endif
    int stat;
-   P(m_mutex); /*    this->dlock();   */
-   m_count++;  /*    this->dlock() */
+   if (!locked) {
+      P(m_mutex); /*    this->dlock();   */
+      m_count++;  /*    this->dlock() */
+   }
    if (this->blocked() && !pthread_equal(this->no_wait_id, pthread_self())) {
       this->num_waiting++;             /* indicate that I am waiting */
       while (this->blocked()) {