git: 75b23c102e8d - main - tests/jaildesc: Use a more efficient mechanism to block
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 Jun 2026 16:00:59 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=75b23c102e8d797654025affdfada0b6771a95ba
commit 75b23c102e8d797654025affdfada0b6771a95ba
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-06-12 14:58:43 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-06-12 14:58:43 +0000
tests/jaildesc: Use a more efficient mechanism to block
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57148
---
tests/sys/kern/jaildesc.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/sys/kern/jaildesc.c b/tests/sys/kern/jaildesc.c
index cfdd1529fdfa..6c7993cfc1d3 100644
--- a/tests/sys/kern/jaildesc.c
+++ b/tests/sys/kern/jaildesc.c
@@ -120,8 +120,7 @@ ATF_TC_BODY(poll_close_race, tc)
error = pthread_create(&thr, NULL, poll_jaildesc, &jd);
ATF_REQUIRE_MSG(error == 0, "pthread_create: %s", strerror(error));
- /* Wait for the thread to block in poll(2). */
- usleep(250000);
+ wait_for_naptime(getpid(), "select");
ATF_REQUIRE_MSG(close(jd) == 0, "close: %s", strerror(errno));
@@ -150,8 +149,7 @@ ATF_TC_BODY(poll_remove_wakeup, tc)
error = pthread_create(&thr, NULL, poll_jaildesc, &jd);
ATF_REQUIRE_MSG(error == 0, "pthread_create: %s", strerror(error));
- /* Wait for the thread to block in poll(2). */
- usleep(250000);
+ wait_for_naptime(getpid(), "select");
ATF_REQUIRE_MSG(jail_remove_jd(jd) == 0,
"jail_remove_jd: %s", strerror(errno));
@@ -219,8 +217,7 @@ ATF_TC_BODY(poll_close_race_get_desc, tc)
error = pthread_create(&thr, NULL, poll_jaildesc, &jd);
ATF_REQUIRE_MSG(error == 0, "pthread_create: %s", strerror(error));
- /* Wait for the thread to block in poll(2). */
- usleep(250000);
+ wait_for_naptime(getpid(), "select");
ATF_REQUIRE_MSG(close(jd) == 0, "close: %s", strerror(errno));