]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/acquire.c
Refactor lock_volumes so most lock a vol rather than globally
[bacula/bacula] / bacula / src / stored / acquire.c
index c8db2956d8b150330f0ca99d9f07fea117e9711b..ef31f74f62baee59813610968ca37dedec963fdb 100644 (file)
@@ -535,6 +535,7 @@ bool release_device(DCR *dcr)
       dev->close();
       free_volume(dev);
    }
+   unlock_volumes();
 
    /* Fire off Alert command and include any output */
    if (!job_canceled(jcr) && dcr->device->alert_command) {
@@ -567,7 +568,6 @@ bool release_device(DCR *dcr)
    Dmsg2(100, "JobId=%u broadcast wait_device_release at %s\n", 
          (uint32_t)jcr->JobId, bstrftimes(tbuf, sizeof(tbuf), (utime_t)time(NULL)));
    pthread_cond_broadcast(&wait_device_release);
-   unlock_volumes();
 
    /*
     * If we are the thread that blocked the device, then unblock it