Date: Wed, 1 Sep 1999 23:24:23 +0200 (MET DST) From: Gisle Vanem To: djgpp AT delorie DOT com Subject: Re: OS/2 + delay() bug In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 1 Sep 1999, sl wrote: > --------------------- > #include > #include > int main() > { > printf("Before delay.\r\n"); > delay(1000); > printf("After delay.\r\n"); > exit(0); > } > ------------------- > > When running under OS/2 4.0, fixpack 10.. if the user presses PAUSE > while delay() is in effect, and attempts to unpause a second later, the > entire DOS session hangs.. It seems that delay() gets into an endless loop > due to the fact that it missed the target time it was waiting for. While the > program was paused, the 'target-time' was missed, and when the system was > unpaused delay() kept on waiting for the target-time which will not be > reached for another 24 hours .. That is an assumption on my part. Don't assume, look at libc-source. It doesn't do itlike that. > I do not > actually know what is at fault but I do know the following for a fact: > > 1) OS/2 4.0, fixpack 10, 11 all hang as mentioned above (even on different > machines) > 2) Win98 does NOT hang It's probably a bug in emulation of Int15h/86. AFAIK Win-NT has a similar problem with delay(). Better to use usleep() altogether. Gisle V. > > Gili > >