httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David Robinson)
Subject Re: Timeout patch
Date Wed, 24 Jan 1996 12:48:00 GMT
>This reset_timeout() routine is a good idea, and will eliminate the need
>for timeout_name being a global.  When I get a minute, I will rewrite the
>patch and resubmit it.  Any suggestions on safeguarding reset_timeout() 
>against a similar race condition?  Perhaps block_alarms()/unblock_alarms() 
>should be stuck around the alarm resetting code?

Firstly, don't rely on timeout_name; it is not set to anything be default.
I suggest that reset_timeout() do
if (!timed out && alarm set)
   reset alarm
   if (timed out) cancel alarm

i.e. reset the alarm and then check to see if, in fact, it had subsequently
timed out.

You might try looking at the return from alarm(), which is how many
seconds it had left to run.


View raw message