Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make PR/53285: Andreas Gustafsson: Buil...



details:   https://anonhg.NetBSD.org/src/rev/233fb1d2116e
branches:  trunk
changeset: 319010:233fb1d2116e
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 13 12:10:36 2018 +0000
description:
PR/53285: Andreas Gustafsson: Build times tripled with make/job.c 1.193
Revert previous:
    2018.05.12.15.14.49/bracket.db:build_wall_time=4896.09
    2018.05.12.18.17.04/bracket.db:build_wall_time=16268.98

diffstat:

 usr.bin/make/job.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (45 lines):

diff -r 9b7eb01d0356 -r 233fb1d2116e usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun May 13 11:13:02 2018 +0000
+++ b/usr.bin/make/job.c        Sun May 13 12:10:36 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.193 2018/05/12 18:17:04 sjg Exp $    */
+/*     $NetBSD: job.c,v 1.194 2018/05/13 12:10:36 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.193 2018/05/12 18:17:04 sjg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.194 2018/05/13 12:10:36 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.193 2018/05/12 18:17:04 sjg Exp $");
+__RCSID("$NetBSD: job.c,v 1.194 2018/05/13 12:10:36 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2944,15 +2944,14 @@
     count = read(tokenWaitJob.inPipe, &tok, 1);
     if (count == 0)
        Fatal("eof on job pipe!");
-    if (count < 0) {
+    if (count < 0 && jobTokensRunning != 0) {
        if (errno != EAGAIN) {
            Fatal("job pipe read: %s", strerror(errno));
        }
        if (DEBUG(JOB))
            fprintf(debug_file, "(%d) blocked for token\n", getpid());
-       if (jobTokensRunning)
-           return FALSE;
-       sleep(1);                       /* avoid busy wait */
+       wantToken = 1;
+       return FALSE;
     }
 
     if (count == 1 && tok != '+') {



Home | Main Index | Thread Index | Old Index