aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2018-05-10 17:55:24 +0000
committerMatt Macy <mmacy@FreeBSD.org>2018-05-10 17:55:24 +0000
commit06bf2a6aefbf98f0717954368a8791cd70bfba30 (patch)
tree1da1c21da6bb2700c9d8dcf0a8eaebb5f492c38a /contrib/bmake
parent137c41d763307e201d12dece785cebe729ae7d73 (diff)
downloadsrc-06bf2a6aefbf98f0717954368a8791cd70bfba30.tar.gz
src-06bf2a6aefbf98f0717954368a8791cd70bfba30.zip
Add simple preempt safe epoch API
Read locking is over used in the kernel to guarantee liveness. This API makes it easy to provide livenes guarantees without atomics. Includes epoch_test kernel module to stress test the API. Documentation will follow initial use case. Test case and improvements to preemption handling in response to discussion with mjg@ Reviewed by: imp@, shurd@ Approved by: sbruno@
Notes
Notes: svn path=/head/; revision=333466
Diffstat (limited to 'contrib/bmake')
-rw-r--r--contrib/bmake/job.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/bmake/job.c b/contrib/bmake/job.c
index c5eca9936efc..00c2304f1dbd 100644
--- a/contrib/bmake/job.c
+++ b/contrib/bmake/job.c
@@ -2121,13 +2121,15 @@ Job_CatchOutput(void)
{
int nready;
Job *job;
- int i;
+ int i, pollToken;
(void)fflush(stdout);
+ pollToken = 0;
+
/* The first fd in the list is the job token pipe */
do {
- nready = poll(fds + 1 - wantToken, nfds - 1 + wantToken, POLL_MSEC);
+ nready = poll(fds + 1 - pollToken, nfds - 1 + pollToken, POLL_MSEC);
} while (nready < 0 && errno == EINTR);
if (nready < 0)