Module Name: src
Committed By: christos
Date: Sun May 13 12:10:37 UTC 2018
Modified Files:
src/usr.bin/make: job.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/usr.bin/make/job.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.193 src/usr.bin/make/job.c:1.194
--- src/usr.bin/make/job.c:1.193 Sat May 12 14:17:04 2018
+++ src/usr.bin/make/job.c Sun May 13 08:10:36 2018
@@ -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 @@ Job_TokenWithdraw(void)
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 != '+') {