pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools



Module Name:    pkgsrc
Committed By:   joerg
Date:           Thu Jun 23 15:07:39 UTC 2016

Modified Files:
        pkgsrc/pkgtools/pbulk-base: Makefile
        pkgsrc/pkgtools/pbulk/files/pbulk/pscan: master.c

Log Message:
pbulk-base-0.53:
After processing the tree-scan job, reassign jobs to all idle clients.
Before, this was only necessary at the very start of the build.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 pkgsrc/pkgtools/pbulk-base/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/pkgtools/pbulk/files/pbulk/pscan/master.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pbulk-base/Makefile
diff -u pkgsrc/pkgtools/pbulk-base/Makefile:1.23 pkgsrc/pkgtools/pbulk-base/Makefile:1.24
--- pkgsrc/pkgtools/pbulk-base/Makefile:1.23    Mon Jun 20 17:54:43 2016
+++ pkgsrc/pkgtools/pbulk-base/Makefile Thu Jun 23 15:07:39 2016
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.23 2016/06/20 17:54:43 joerg Exp $
+# $NetBSD: Makefile,v 1.24 2016/06/23 15:07:39 joerg Exp $
 
-DISTNAME=      pbulk-base-0.52
+DISTNAME=      pbulk-base-0.53
 COMMENT=       Core components of the modular bulk build framework
 
 .include "../../pkgtools/pbulk/Makefile.common"

Index: pkgsrc/pkgtools/pbulk/files/pbulk/pscan/master.c
diff -u pkgsrc/pkgtools/pbulk/files/pbulk/pscan/master.c:1.11 pkgsrc/pkgtools/pbulk/files/pbulk/pscan/master.c:1.12
--- pkgsrc/pkgtools/pbulk/files/pbulk/pscan/master.c:1.11       Mon Dec  7 16:52:40 2015
+++ pkgsrc/pkgtools/pbulk/files/pbulk/pscan/master.c    Thu Jun 23 15:07:39 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: master.c,v 1.11 2015/12/07 16:52:40 joerg Exp $ */
+/* $NetBSD: master.c,v 1.12 2016/06/23 15:07:39 joerg Exp $ */
 
 /*-
  * Copyright (c) 2007, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -68,6 +68,7 @@ struct scan_peer {
 };
 
 static void    assign_job(struct scan_peer *);
+static void    reassign_jobs(void);
 
 static void
 do_nothing(void *arg)
@@ -106,6 +107,7 @@ finish_job(void *arg)
        LIST_REMOVE(peer, peer_link);
        process_job(peer->job, JOB_DONE);
        assign_job(peer);
+       reassign_jobs();
 }
 
 static void
@@ -202,6 +204,21 @@ assign_job(struct scan_peer *peer)
 }
 
 static void
+reassign_jobs(void)
+{
+       struct scan_peer *peer;
+
+       while ((peer = LIST_FIRST(&inactive_peers)) != NULL) {
+               if (!has_job())
+                       break;
+               LIST_REMOVE(peer, peer_link);
+               assign_job(peer);
+               if (peer-> job == NULL)
+                       break;
+       }
+}
+
+static void
 listen_handler(int sock, void *arg)
 {
        struct scan_peer *peer;
@@ -225,7 +242,6 @@ listen_handler(int sock, void *arg)
 static void
 child_handler(struct signal_event *ev)
 {
-       struct scan_peer *peer;
        int status;
 
        if (waitpid(child_pid, &status, WNOHANG) == -1) {
@@ -238,13 +254,7 @@ child_handler(struct signal_event *ev)
 
        clients_started = 1;
        signal_del(ev);
-
-       while ((peer = LIST_FIRST(&inactive_peers)) != NULL) {
-               LIST_REMOVE(peer, peer_link);
-               assign_job(peer);
-               if (peer-> job == NULL)
-                       break;
-       }
+       reassign_jobs();
 }
 
 void



Home | Main Index | Thread Index | Old Index