From: hadaq Date: Sun, 27 Oct 2002 12:26:33 +0000 (+0000) Subject: Good idea from Wolfgang -- mm X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=e78348ca9c573861c071dd11ea06362a8bfe4b21;p=daqdata.git Good idea from Wolfgang -- mm --- diff --git a/hadaq/hwshow.c b/hadaq/hwshow.c index 677bc0c..b284c9e 100644 --- a/hadaq/hwshow.c +++ b/hadaq/hwshow.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwshow.c,v 6.30 2002-10-27 09:11:14 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwshow.c,v 6.31 2002-10-27 12:26:33 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L #include @@ -100,6 +100,8 @@ void Hardware_waitForTrigger(Hardware *my, void *subEvt) { int i; int nRequests = 0; + int nPoll = 0; + const int nPollMax = 60 / my->nShips; for (i = 0; i < my->nShips; i++) { if (HwShip_isEmpty(my->ship[i])) { @@ -117,13 +119,13 @@ void Hardware_waitForTrigger(Hardware *my, void *subEvt) } } } -#if 0 +#if 1 /* * This sleep prevents a tight loop which stops work on real * time systems if the priority of readout is not lowered. * When not using the sleep use option -p -2 for daq_readout. */ - if (nRequests == my->nShips) { + if (nRequests == my->nShips && nPoll++ >= nPollMax) { struct timespec tS, *t = &tS; t->tv_sec = 0; t->tv_nsec = 020000000;