Module Name: src Committed By: martin Date: Tue Oct 15 18:34:34 UTC 2019
Modified Files: src/tests/lib/libc/sys [netbsd-9]: t_ptrace_wait.c Log Message: Pull up following revision(s) (requested by kamil in ticket #312): tests/lib/libc/sys/t_ptrace_wait.c: revision 1.135 Bump the number of threads in LWP t_ptrace_wait*() tests from to 100 This is a torture, but on purpose to catch LWP_CREATED and LWP_EXITED bugs. The threads do nothing other than calling sched_yield() in a loop. MAXLWP is now defined to 2048 on all ports. This change effects the following tests: - trace_thread_nolwpevents - trace_thread_lwpexit - trace_thread_lwpcreate - trace_thread_lwpcreate_and_exit To generate a diff of this commit: cvs rdiff -u -r1.131.2.1 -r1.131.2.2 src/tests/lib/libc/sys/t_ptrace_wait.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.131.2.1 src/tests/lib/libc/sys/t_ptrace_wait.c:1.131.2.2 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.131.2.1 Tue Oct 15 18:22:55 2019 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Tue Oct 15 18:34:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.131.2.1 2019/10/15 18:22:55 martin Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.131.2.2 2019/10/15 18:34:34 martin Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.131.2.1 2019/10/15 18:22:55 martin Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.131.2.2 2019/10/15 18:34:34 martin Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -5429,6 +5429,8 @@ TRACEME_EXEC(traceme_signalignored_exec, /// ---------------------------------------------------------------------------- +#define TRACE_THREADS_NUM 100 + static volatile int done; static void * @@ -5437,8 +5439,8 @@ trace_threads_cb(void *arg __unused) done++; - while (done < 3) - continue; + while (done < TRACE_THREADS_NUM) + sched_yield(); return NULL; } @@ -5457,7 +5459,7 @@ trace_threads(bool trace_create, bool tr const int elen = sizeof(event); struct ptrace_siginfo info; - pthread_t t[3]; + pthread_t t[TRACE_THREADS_NUM]; int rv; size_t n; lwpid_t lid;