]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
metaplugin - Remove locking on request.
authorRadosław Korzeniewski <radoslaw@korzeniewski.net>
Thu, 24 Jun 2021 14:20:35 +0000 (16:20 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:02 +0000 (09:03 +0100)
bacula/src/plugins/fd/pluginlib/metaplugin.cpp
bacula/src/plugins/fd/pluginlib/metaplugin.h

index d445e058ed614c1eceb8e655437094d34493abec..ce15c27d305ddeab23ee051e1645273652bb64ee 100644 (file)
@@ -1161,7 +1161,7 @@ bRC METAPLUGIN::handlePluginEvent(bpContext *ctx, bEvent *event, void *value)
    // extract original plugin context, basically it should be `this`
    METAPLUGIN *pctx = (METAPLUGIN *)ctx->pContext;
    // this ensures that handlePluginEvent is thread safe for extracted pContext
-   smart_lock<smart_mutex> lg(&pctx->mutex);
+   // smart_lock<smart_mutex> lg(&pctx->mutex); - removed on request
 
    if (job_cancelled) {
       return bRC_Error;
@@ -1862,7 +1862,7 @@ bRC METAPLUGIN::pluginIO(bpContext *ctx, struct io_pkt *io)
 
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -1981,7 +1981,7 @@ bRC METAPLUGIN::startBackupFile(bpContext *ctx, struct save_pkt *sp)
 
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2174,7 +2174,7 @@ bRC METAPLUGIN::endBackupFile(bpContext *ctx)
 
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2245,7 +2245,7 @@ bRC METAPLUGIN::createFile(bpContext *ctx, struct restore_pkt *rp)
 
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2375,7 +2375,7 @@ bRC METAPLUGIN::handleXACLdata(bpContext *ctx, struct xacl_pkt *xacl)
 {
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2454,7 +2454,7 @@ bRC METAPLUGIN::queryParameter(bpContext *ctx, struct query_pkt *qp)
 
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2542,7 +2542,7 @@ bRC METAPLUGIN::metadataRestore(bpContext *ctx, struct meta_pkt *mp)
 {
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2604,7 +2604,7 @@ bRC METAPLUGIN::checkFile(bpContext * ctx, char *fname)
    if ((!CUSTOMNAMESPACE && isourpluginfname(PLUGINPREFIX, fname)) || (CUSTOMNAMESPACE && isourpluginfname(PLUGINNAMESPACE, fname)))
    {
       // synchronie access to job_cancelled variable
-      smart_lock<smart_mutex> lg(&mutex);
+      // smart_lock<smart_mutex> lg(&mutex); - removed on request
       if (!job_cancelled) {
          if (::checkFile != NULL) {
             return ::checkFile(ctx, fname);
@@ -2649,7 +2649,7 @@ bRC backendctx_termination_func(PTCOMM *ptcomm, void *cp)
  */
 void METAPLUGIN::terminate_backends_oncancel(bpContext *ctx)
 {
-   smart_lock<smart_mutex> lg(&mutex);
+   // smart_lock<smart_mutex> lg(&mutex); - removed on request
    if (job_cancelled) {
       DMSG0(ctx, DINFO, "Ensure backend termination on cancelled job\n");
       backend.foreach_command_status(backendctx_termination_func, ctx);
index cd6b89ea0faa94e32d3022c611cbc97a0d6855b3..b74658d43e57525f0a2cf95e7268bfd8319e6714 100644 (file)
@@ -180,7 +180,7 @@ private:
    };
 
    bool job_cancelled;           // it signal the metaplugin that job was cancelled
-   smart_mutex mutex;            // mutex to synchronize data access
+   // smart_mutex mutex;            // mutex to synchronize data access - removed on request
    bool backend_available;       // When `False` then backend program is unuseable or unavailable
    POOL_MEM backend_error;       // Holds the error string when backend program is unavailable
    MODE mode;                    // Plugin mode of operation