X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fworm.c;h=7c4842e4004f3bc772080e9dd9f2607402691e60;hb=6315e1a380ecdb706d4f6518d2e8c7eb0db8fbe2;hp=aca96c6f3127ee120d1a84bcfbdacfa86a32a028;hpb=6641601a9dd7f34deeaa978899b3730b27635afb;p=ncurses.git diff --git a/test/worm.c b/test/worm.c index aca96c6f..7c4842e4 100644 --- a/test/worm.c +++ b/test/worm.c @@ -53,7 +53,7 @@ traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.88 2022/12/04 00:40:11 tom Exp $ + $Id: worm.c,v 1.89 2022/12/24 20:46:49 tom Exp $ */ #include @@ -368,7 +368,11 @@ start_worm(void *arg) unsigned long compare = 0; Trace(("start_worm")); while (!quit_worm((int) (((struct worm *) arg) - worm))) { - while (compare < sequence) { + for (;;) { + bool done = FALSE; + Locked(done = (compare >= sequence)); + if (done) + break; ++compare; USING_WINDOW2(stdscr, draw_worm, arg); }