public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Gaius Mulley <gaius@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4765] PR-108122 Reduce sleep times in gm2/pimcoroutines/run/pass/testtime.mod Date: Sun, 18 Dec 2022 10:06:32 +0000 (GMT) [thread overview] Message-ID: <20221218100632.29F9A385D0C3@sourceware.org> (raw) https://gcc.gnu.org/g:0b2428ee8305188500e4f08e088a430500f1ad9e commit r13-4765-g0b2428ee8305188500e4f08e088a430500f1ad9e Author: Gaius Mulley <gaiusmod2@gmail.com> Date: Sun Dec 18 10:04:02 2022 +0000 PR-108122 Reduce sleep times in gm2/pimcoroutines/run/pass/testtime.mod Change time unit to 1 jiffy (with respect to TimerHandler.def) rather than a second. gcc/testsuite/ChangeLog: * gm2/pimcoroutines/run/pass/testtime.mod: Reduce sleep times in the test by a factor of 25. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com> Diff: --- .../gm2/pimcoroutines/run/pass/testtime.mod | 48 ++++++++++++---------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod b/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod index fa43163b107..2e770ae130a 100644 --- a/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod +++ b/gcc/testsuite/gm2/pimcoroutines/run/pass/testtime.mod @@ -1,4 +1,4 @@ -(* Copyright (C) 2005-2020 +(* Copyright (C) 2005-2022 Free Software Foundation, Inc. *) (* This file is part of GNU Modula-2. @@ -31,54 +31,58 @@ FROM SYSTEM IMPORT ADR ; FROM libc IMPORT write, printf ; +CONST + TicksPerTimeUnit = 1 ; + + (* - OneSecond - + OneUnit - *) -PROCEDURE OneSecond ; +PROCEDURE OneUnit ; VAR n: CARDINAL ; BEGIN OldInts := TurnInterrupts (MIN (PROTECTION)) ; - printf ("1 second process has come to life\n"); + printf ("1 unit process has come to life\n"); n := 0 ; LOOP - Sleep (1*TicksPerSecond) ; + Sleep (1*TicksPerTimeUnit) ; INC (n) ; - printf ("%d seconds\n", n); + printf ("%d units\n", n); END -END OneSecond ; +END OneUnit ; (* - FourSeconds - + FourUnits - *) -PROCEDURE FourSeconds ; +PROCEDURE FourUnits ; VAR n: CARDINAL ; BEGIN OldInts := TurnInterrupts (MIN (PROTECTION)) ; - printf ("4 seconds process has come to life\n"); + printf ("4 units process has come to life\n"); n := 0 ; LOOP - Sleep (4*TicksPerSecond) ; + Sleep (4*TicksPerTimeUnit) ; INC (n) ; - printf ("4 second alarm (%d occurance)\n", n); + printf ("4 units alarm (%d occurance)\n", n); END -END FourSeconds ; +END FourUnits ; (* - SixSeconds - + SixUnits - *) -PROCEDURE SixSeconds ; +PROCEDURE SixUnits ; VAR n: CARDINAL ; BEGIN OldInts := TurnInterrupts (MAX (PROTECTION)) ; - printf ("6 seconds process has come to life\n"); + printf ("6 units process has come to life\n"); n := 0 ; LOOP Timeout := ArmEvent (6*TicksPerSecond) ; @@ -87,10 +91,10 @@ BEGIN WriteString ('...someone cancelled it...') ELSE INC (n) ; - printf ("6 second alarm (%d occurance)\n", n) + printf ("6 unit alarm (%d occurance)\n", n) END END -END SixSeconds ; +END SixUnits ; CONST @@ -107,10 +111,10 @@ BEGIN printf ("now to create three processes...\n") ; - p1 := Resume (InitProcess (OneSecond , StackSize, '1')) ; - p4 := Resume (InitProcess (FourSeconds, StackSize, '4')) ; - p6 := Resume (InitProcess (SixSeconds , StackSize, '6')) ; + p1 := Resume (InitProcess (OneUnit , StackSize, '1')) ; + p4 := Resume (InitProcess (FourUnits, StackSize, '4')) ; + p6 := Resume (InitProcess (SixUnits , StackSize, '6')) ; - Sleep (20*TicksPerSecond) ; + Sleep (20*TicksPerTimeUnit) ; printf ("successfully completed, finishing now.\n") END testtime.
reply other threads:[~2022-12-18 10:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221218100632.29F9A385D0C3@sourceware.org \ --to=gaius@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).