]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
pluginlib: Remove smart_lock.
authorRadosław Korzeniewski <radoslaw@korzeniewski.net>
Fri, 26 Nov 2021 17:20:24 +0000 (18:20 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:56 +0000 (13:56 +0200)
bacula/src/plugins/fd/pluginlib/Makefile
bacula/src/plugins/fd/pluginlib/metaplugin.cpp
bacula/src/plugins/fd/pluginlib/pluginctx.cpp

index cf0e292466f4ce2e4638cc99190f6aae01b33e4f..9f1dc3b45eded1ceb30c6743129c1521d8f24010 100644 (file)
@@ -26,21 +26,17 @@ PLUGINCTXOBJ = $(filter %.lo,$(PLUGINCTXSRC:.cpp=.lo))
 COMMCTXSRC = commctx.h
 SMARTALISTSRC = smartalist.h
 SMARTPTRSRC = smartptr.h
-SMARTMUTEXSRC = smartmutex.h
-SMARTLOCKSRC = smartlock.h
-
-PLUGINLIBSTEST = pluginlib_test.cpp $(PLUGINLIBSSRC) $(UNITTESTSOBJ) $(INIOBJ)
-PLUGINLIBSTESTOBJ = $(filter %.lo,$(PLUGINLIBSTEST:.cpp=.lo))
-ISO8601TEST = iso8601_test.cpp $(ISO8601SRC) $(UNITTESTSOBJ)
-ISO8601TESTOBJ = $(filter %.lo,$(ISO8601TEST:.cpp=.lo))
-COMMCTXTEST = commctx_test.cpp $(COMMCTXSRC) $(SMARTALISTSRC) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) $(INIOBJ)
-COMMCTXTESTOBJ = $(filter %.lo,$(COMMCTXTEST:.cpp=.lo))
-SMARTALISTTEST = smartalist_test.cpp $(SMARTALISTSRC) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) $(INIOBJ)
-SMARTALISTTESTOBJ = $(filter %.lo,$(SMARTALISTTEST:.cpp=.lo))
-SMARTPTRTEST = smartptr_test.cpp $(SMARTPTRSRC) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) $(INIOBJ)
-SMARTPTRTESTOBJ = $(filter %.lo,$(SMARTPTRTEST:.cpp=.lo))
-SMARTLOCKTEST = smartlock_test.cpp $(SMARTLOCKSRC) $(SMARTMUTEXSRC) $(UNITTESTSOBJ)
-SMARTLOCKTESTOBJ = $(filter %.lo,$(SMARTLOCKTEST:.cpp=.lo))
+
+PLUGINLIBSTEST = pluginlib_test.cpp $(PLUGINLIBSSRC)
+PLUGINLIBSTESTOBJ = $(filter %.lo,$(PLUGINLIBSTEST:.cpp=.lo)) $(INIOBJ) $(UNITTESTSOBJ)
+ISO8601TEST = iso8601_test.cpp $(ISO8601SRC)
+ISO8601TESTOBJ = $(filter %.lo,$(ISO8601TEST:.cpp=.lo)) $(UNITTESTSOBJ)
+COMMCTXTEST = commctx_test.cpp $(COMMCTXSRC) $(SMARTALISTSRC)
+COMMCTXTESTOBJ = $(filter %.lo,$(COMMCTXTEST:.cpp=.lo)) $(INIOBJ) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ)
+SMARTALISTTEST = smartalist_test.cpp $(SMARTALISTSRC)
+SMARTALISTTESTOBJ = $(filter %.lo,$(SMARTALISTTEST:.cpp=.lo)) $(INIOBJ) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ)
+SMARTPTRTEST = smartptr_test.cpp $(SMARTPTRSRC)
+SMARTPTRTESTOBJ = $(filter %.lo,$(SMARTPTRTEST:.cpp=.lo)) $(INIOBJ) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ)
 
 METAPLUGINTEST = metaplugin_test.cpp $(METAPLUGINSRC)
 METAPLUGINTESTOBJ = $(filter %.lo,$(METAPLUGINTEST:.cpp=.lo)) $(PTCOMMOBJ) $(PLUGINLIBSOBJ) $(METAPLUGINOBJ) $(UNITTESTSOBJ) $(LIBBACOBJ) $(LIBBACCFGOBJ)
@@ -51,7 +47,7 @@ TESTMETAPLUGINBACKENDOBJ = $(TESTMETAPLUGINBACKENDSRC:.c=.lo)
 # COMMONPLUGINOBJ = $(PLUGINLIBSOBJ) $(ISO8601OBJ) $(EXECPROGOBJ)
 COMMONPLUGINOBJ = $(PLUGINLIBSOBJ) $(PTCOMMOBJ) $(METAPLUGINOBJ) $(PLUGINCLASSOBJ) $(PLUGINBASEOBJ)
 # COMMONPLUGINTESTS = iso8601_test
-COMMONPLUGINTESTS = pluginlib_test smartalist_test smartptr_test commctx_test smartlock_test iso8601_test
+COMMONPLUGINTESTS = pluginlib_test smartalist_test smartptr_test commctx_test iso8601_test
 
 .c.lo:
        @echo "Compiling $< ..."
index cba68d140067b281af002d6440affe52f6a3a5ab..05ef0bb479f7959476b0c66e3ecb4cc349e83175 100644 (file)
@@ -1207,7 +1207,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); - removed on request
+   // lock_guard lg(&pctx->mutex); - removed on request
 
    if (job_cancelled) {
       return bRC_Error;
@@ -2177,7 +2177,7 @@ bRC METAPLUGIN::pluginIO(bpContext *ctx, struct io_pkt *io)
 
    {
       // synchronie access to job_cancelled variable
-      // smart_lock<smart_mutex> lg(&mutex); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2507,7 +2507,7 @@ bRC METAPLUGIN::endBackupFile(bpContext *ctx)
 
    {
       // synchronie access to job_cancelled variable
-      // smart_lock<smart_mutex> lg(&mutex); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2611,7 +2611,7 @@ bRC METAPLUGIN::createFile(bpContext *ctx, struct restore_pkt *rp)
 
    {
       // synchronie access to job_cancelled variable
-      // smart_lock<smart_mutex> lg(&mutex); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2723,7 +2723,7 @@ bRC METAPLUGIN::handleXACLdata(bpContext *ctx, struct xacl_pkt *xacl)
 {
    {
       // synchronie access to job_cancelled variable
-      // smart_lock<smart_mutex> lg(&mutex); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2795,7 +2795,7 @@ bRC METAPLUGIN::queryParameter(bpContext *ctx, struct query_pkt *qp)
 
    {
       // synchronie access to job_cancelled variable
-      // smart_lock<smart_mutex> lg(&mutex); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2913,7 +2913,7 @@ bRC METAPLUGIN::metadataRestore(bpContext *ctx, struct meta_pkt *mp)
 {
    {
       // synchronie access to job_cancelled variable
-      // smart_lock<smart_mutex> lg(&mutex); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (job_cancelled) {
          return bRC_Error;
       }
@@ -2975,7 +2975,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); - removed on request
+      // lock_guard lg(&mutex); - removed on request
       if (!job_cancelled) {
          if (::checkFile != NULL) {
             return ::checkFile(ctx, fname);
@@ -3020,7 +3020,7 @@ bRC backendctx_termination_func(PTCOMM *ptcomm, void *cp)
  */
 void METAPLUGIN::terminate_backends_oncancel(bpContext *ctx)
 {
-   // smart_lock<smart_mutex> lg(&mutex); - removed on request
+   // lock_guard 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 00299e26d3d7cf6fb8e9c74c6d942b36f4d9ba5f..6c4b128bfb9023f68cdd9d94640627f8aa87f7ba 100644 (file)
@@ -986,7 +986,7 @@ namespace pluginlib
       // extract original plugin context, basically it should be `this`
       PLUGINCLASS *pctx = (PLUGINCLASS *)ctx->pContext;
       // this ensures that handlePluginEvent is thread safe for extracted pContext
-      // smart_lock<smart_mutex> lg(&pctx->mutex); - removed on request
+      // lock_guard lg(&pctx->mutex); - removed on request
 
       if (job_cancelled) {
          return bRC_Error;
@@ -1931,7 +1931,7 @@ namespace pluginlib
 
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (job_cancelled) {
             return bRC_Error;
          }
@@ -2214,7 +2214,7 @@ namespace pluginlib
 
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (job_cancelled) {
             return bRC_Error;
          }
@@ -2316,7 +2316,7 @@ namespace pluginlib
 
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (job_cancelled) {
             return bRC_Error;
          }
@@ -2428,7 +2428,7 @@ namespace pluginlib
    {
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (job_cancelled) {
             return bRC_Error;
          }
@@ -2500,7 +2500,7 @@ namespace pluginlib
 
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (job_cancelled) {
             return bRC_Error;
          }
@@ -2618,7 +2618,7 @@ namespace pluginlib
    {
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (job_cancelled) {
             return bRC_Error;
          }
@@ -2680,7 +2680,7 @@ namespace pluginlib
       if ((!CUSTOMNAMESPACE && isourpluginfname(PLUGINPREFIX, fname)) || (CUSTOMNAMESPACE && isourpluginfname(PLUGINNAMESPACE, fname)))
       {
          // synchronie access to job_cancelled variable
-         // smart_lock<smart_mutex> lg(&mutex); - removed on request
+         // lock_guard lg(&mutex); - removed on request
          if (!job_cancelled) {
             if (::checkFile != NULL) {
                return ::checkFile(ctx, fname);