X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fworm.c;h=7c4842e4004f3bc772080e9dd9f2607402691e60;hp=aca96c6f3127ee120d1a84bcfbdacfa86a32a028;hb=a0914678507b8ee1d1a0440625235fd7b48964bc;hpb=38e60f5f7931446480f1a7ca707c370ec365ba47 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); }