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

Talarm() problem



 Hi!

 Yesterday I've been hit by a (to me) new problem: The program I was
writing was hanging in an endless loop (well, actually that isn't
new ;), so I added a SIGALRM handler to be called periodically to
give me some diagnostic output about what's going wrong. The (new)
problem is that this code starts doing its job, but then, some alerts
later it simply doesn't get called any more. This happened under 1.10h6
(although I doubt it's a specific _h6_ problem). The signal handler
itself of course runs perfectly well and the rest of the program
really doesn't do any nasty things. The only thing it does is calling
Fselect() with another timeout. And that seems to be the problem: If
you'll try this one:

/*
 *	alarm.c
 */

#include <osbind.h>
#include <mintbind.h>
#include <signal.h>

int sigalrm(long arg)
{
	Cconout(7);
	Talarm(1);
	return 0;
}

void main()
{
	char	c;
	long	mask;

	Psignal(SIGALRM, sigalrm);
	Talarm(1);

	while (42) {
		mask = 1;
		(void)Fselect(200, &mask, 0L, 0L);
		if (mask)
			Fread(0, 1L, &c);
	}
}

 you'll see the effect that it stops beeping after some keys have been
pressed. Due to earlier problems I've had with some `features' I'd like
to ask: Is that officially documented behaviour? ;) It seems like every
process supports only one active timeout. Shouldn't this be fixed?

ciao,
TeSche
--
Torsten Scherer (TeSche, Schiller...), itschere@techfak.uni-bielefeld.de
Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
| Use any of "finger itschere@129.70.131.2-15" for adresses and more.	|
| Last updated: 31. July 1994						|