]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/sysman.c
Merge changes from CUPS 1.4svn-r8628.
[thirdparty/cups.git] / scheduler / sysman.c
index 74f1a034279aed658b905daaf4081b02592e2788..212f0fdd3e61325007054a32c41fc3413699af99 100644 (file)
@@ -37,6 +37,9 @@
  */
 
 #include "cupsd.h"
+#ifdef HAVE_VPROC_TRANSACTION_BEGIN
+#  include <vproc.h>
+#endif /* HAVE_VPROC_TRANSACTION_BEGIN */
 
 
 /*
@@ -138,6 +141,9 @@ cupsdSetBusyState(void)
     "Active clients and printing jobs",
     "Active clients, printing jobs, and dirty files"
   };
+#ifdef HAVE_VPROC_TRANSACTION_BEGIN
+  static vproc_transaction_t vtran = 0;        /* Current busy transaction */
+#endif /* HAVE_VPROC_TRANSACTION_BEGIN */
 
 
   newbusy = (DirtyCleanTime ? 1 : 0) |
@@ -148,6 +154,16 @@ cupsdSetBusyState(void)
   {
     busy = newbusy;
 
+#ifdef HAVE_VPROC_TRANSACTION_BEGIN
+    if (busy && !vtran)
+      vtran = vproc_transaction_begin(NULL);
+    else if (!busy && vtran)
+    {
+      vproc_transaction_end(NULL, vtran);
+      vtran = 0;
+    }
+#endif /* HAVE_VPROC_TRANSACTION_BEGIN */
+
     cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdSetBusyState: %s", busy_text[busy]);
   }
 }