pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools pbulk-base-0.53:
details: https://anonhg.NetBSD.org/pkgsrc/rev/e4f135bd4834
branches: trunk
changeset: 349011:e4f135bd4834
user: joerg <joerg%pkgsrc.org@localhost>
date: Thu Jun 23 15:07:39 2016 +0000
description:
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.
diffstat:
pkgtools/pbulk-base/Makefile | 4 ++--
pkgtools/pbulk/files/pbulk/pscan/master.c | 28 +++++++++++++++++++---------
2 files changed, 21 insertions(+), 11 deletions(-)
diffs (82 lines):
diff -r 19306301866b -r e4f135bd4834 pkgtools/pbulk-base/Makefile
--- a/pkgtools/pbulk-base/Makefile Thu Jun 23 15:05:38 2016 +0000
+++ b/pkgtools/pbulk-base/Makefile Thu Jun 23 15:07:39 2016 +0000
@@ -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"
diff -r 19306301866b -r e4f135bd4834 pkgtools/pbulk/files/pbulk/pscan/master.c
--- a/pkgtools/pbulk/files/pbulk/pscan/master.c Thu Jun 23 15:05:38 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/pscan/master.c Thu Jun 23 15:07:39 2016 +0000
@@ -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 @@
};
static void assign_job(struct scan_peer *);
+static void reassign_jobs(void);
static void
do_nothing(void *arg)
@@ -106,6 +107,7 @@
LIST_REMOVE(peer, peer_link);
process_job(peer->job, JOB_DONE);
assign_job(peer);
+ reassign_jobs();
}
static void
@@ -202,6 +204,21 @@
}
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 @@
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 @@
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