svn commit: r359743 - user/pho/stress2/misc
Peter Holm
pho at FreeBSD.org
Thu Apr 9 08:33:39 UTC 2020
Author: pho
Date: Thu Apr 9 08:33:38 2020
New Revision: 359743
URL: https://svnweb.freebsd.org/changeset/base/359743
Log:
Limit runtime.
Modified:
user/pho/stress2/misc/signal0.sh
Modified: user/pho/stress2/misc/signal0.sh
==============================================================================
--- user/pho/stress2/misc/signal0.sh Thu Apr 9 08:28:32 2020 (r359742)
+++ user/pho/stress2/misc/signal0.sh Thu Apr 9 08:33:38 2020 (r359743)
@@ -52,7 +52,7 @@ s=0
# an INVARIANTS kernel
start=`date +%s`
for i in `jot 500`; do
- /tmp/signal0
+ /tmp/signal0 || { s=1; break; }
[ $((`date +%s` - start)) -gt 900 ] &&
{ echo "Timeout @ loop $i/500"; s=1; break; }
done
@@ -68,6 +68,8 @@ EOF
#include <stdio.h>
#include <stdlib.h>
+#define N 3000
+
static void
signal_handler(int signum, siginfo_t *si, void *context) {
if (signum != SIGUSR1) {
@@ -90,7 +92,7 @@ main(void)
sa.sa_sigaction = signal_handler;
if (sigfillset(&sa.sa_mask) != 0) abort();
if (sigaction(SIGUSR1, &sa, NULL) != 0) abort();
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < N; i++) {
pthread_t t;
if (pthread_create(&t, NULL, thread_func, NULL) == 0)
More information about the svn-src-user
mailing list