From nobody Fri Jun 12 23:02:03 2026 Received: from out203-205-221-155.mail.qq.com (out203-205-221-155.mail.qq.com [203.205.221.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BA0B2D7398 for ; Tue, 12 May 2026 07:16:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778570214; cv=none; b=Q4BCirYCMxeYYnkClsDnbY8uXempVxiaJk34G4WpCPAT6qykf8EupQSoJe96io/BAZiw1SE69lrYzGsGZkb78meaS3UvcKP/7zNQfkKL0KHdg5YfDhiTSwVmm6h/vjFcPNvf2amNvPCEK/LUNs5xQD+386gvyDH83vEDv4OKaU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778570214; c=relaxed/simple; bh=HFD9M5t1P4aIhMmAv30q0/GRAkcUUMoFUh+ZZ5DqTwY=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=dQstTHswHSBfhOg3QcAzn7hbI+9SSRRsDUj6c9eKn69Rbid9pgidtOjRe15CaxqOoBv47YiVHthHn+nSvftNyzukVk9DGQAoZu+Gu1G+cvxbo7+o/5WpmRjzo/iG2PnWs5C0AqBhl/XRSoQrJsCPDWG9pQTGZFh7P0QS3swWOE4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=fFwO1j4K; arc=none smtp.client-ip=203.205.221.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="fFwO1j4K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1778570206; bh=Lkc4p2kMOO2gidUulgWb5kkE5ShGQu/O14IAX3jTqVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fFwO1j4KjwFcOkNhXA8ZuFGqdZalW5iR+AVoFdrJJ3qGrVLnBdWCFw66976i/t51V 64g3yjRQinpSnsOK5nliTfsrfl/lzoiuvz4xP6UwZr4QLRPOn2VUoj9b14nlxsD1gl YuZRmvnyfNY2hqTKddsZ1bQYrKLOj3TFrbDqVqqg= Received: from meizu-Precision-3660.meizu.com ([112.91.84.73]) by newxmesmtplogicsvrszb51-1.qq.com (NewEsmtp) with SMTP id 350AB046; Tue, 12 May 2026 15:13:16 +0800 X-QQ-mid: xmsmtpt1778569996tblhq1jbl Message-ID: X-QQ-XMAILINFO: N7IHLsEATiKziGWcPfl1eNrOtr1OIwpeID8ic6dnPy6XT7jYTa4tbiMcFgzD40 87xmKwuazzVgKlPAVlEwEiwbakn4jarfUF9ZPwmrD9rt1f0Tv+dIj38Vk7DvggNB9VvnO8/uXIpU xqTxn6/qPto0yhS0j+vrDHduhjnyVsW6TSxCcmTXV6Ry5EssCpwH9cfwjZg59i3FrKvEjQdV18Im q0hZDulzb6V+pTlyTNL+QyKe4On8g1S/jKuBUTosCpYWvZRk07F545SR/YLiTEM0YtepGhGPoxd7 P0uvGN82QRozLabQb3drJ2a/UWDqpVdNKajQLuovOtKMNTuw7akeTLcEwXS7QFYOKCxrRvBSBnZD wmMkqr7f/QF7bdrmP6I156OI87ycPJO5gTvKqbPCK/llX0c8MzQ3uxSdE8XL3b3WIZj4WBfJ4Vm3 goTnO4QdMf381eVusCcFlDZgZayvfmt0n7iODAH/UAs40sbqSDiATNwl7om1EAaoaTessBNIFGUL xET1IYJqTh7Y6Zk0x453oIIuYaCT/R2njI95Rc7pXiv2/7n4OaOoMfZhRBsn6QzLnL6/waa+PQyP ABB5+NkQnpDf1H8+wMzCtSFU9gcMv6sv7D+5MTab5vWpU/yFtH1uhyCWKSh+k8LCu4T/6AUMx1eG BZnsZuRF4eX1Uh6RIgMp8h3molUi4YG6gyqfar2zTYv+iGqIE2s34t+UfFsbZQwM2rtZEEmin6em 9Ufj9oCabYLkSJ1sJpsZ+hnLU04nGjXNApTPg+u6kgSx9VV6M/kKbGlEiaEBO/h4EMnAFtY/a5ue VIWdfr7FNAF4y4nmYf5F/35iSZXAK51+Ee1XhSi0w4lqh8O6+DClN8Ho+FJU57t6Scsz/sDwZGul ps75PdVfHfve3EoR6OCD2usZmB03bz1yvlqTytNta+7HqJCjiZcorzP+dlhdAd1TOSTAFlH2cfWA MBVrfHrXwSyJGjh7Z7NbJmjlbEe5pANJPiqUKpu3blD+qi7eHpDGAHf0kaQxKgzZpUf10bKlqQSw blBy/F4iqU8nt5vmt/1YlNh3R08++K/5PfVwFaUWQvBLvPXaq+sQ/jTondsW33plj7B7ZJUhj5oH OfmHaLVwMgET/6neMGPvJIbnsWNym2BJNGqRHn90qHcSYPnHM9KUrfI9FpDg== X-QQ-XMRINFO: MSVp+SPm3vtSI1QTLgDHQqIV1w2oNKDqfg== From: Yuwen Chen To: ywen.chen@foxmail.com Cc: akpm@linux-foundation.org, andrealmeid@igalia.com, bigeasy@linutronix.de, colin.i.king@gmail.com, dave@stgolabs.net, dvhart@infradead.org, edliaw@google.com, justinstitt@google.com, kernel-team@android.com, licayy@foxmail.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, luto@mit.edu, mingo@redhat.com, morbo@google.com, nathan@kernel.org, ndesaulniers@google.com, peterz@infradead.org, shuah@kernel.org, tglx@kernel.org, usama.anjum@collabora.com, wakel@google.com Subject: [PATCH v7 1/2] selftests/futex: implement the interfaces related to threads Date: Tue, 12 May 2026 15:13:14 +0800 X-OQ-MSGID: <20260512071314.3105991-1-ywen.chen@foxmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are timing issues in the use of threads in some unit test cases for futex. A potentially good solution is to check whether the thread is in the sleep state after creating it. A file named futex_thread.h is added, in which several thread-related functions are implemented to facilitate the solution of this problem. Signed-off-by: Yuwen Chen --- v6->v7: 1. Changed `static` to `static inline` for all functions to prevent compiler warnings about unused functions. 2. Added `sleep_time_us` variable with zero-guard in __wait_for_thread() to prevent tight loop when timeout_us < WAIT_THREAD_RETRIES. 3. Removed fallback usleep(100ms) from futex_wait_for_thread(); the caller is now responsible for handling errors. 4. Added return value check for pthread_barrier_init(). 5. Added pthread_barrier_destroy() cleanup on pthread_create() failure. .../selftests/futex/functional/Makefile | 3 +- .../selftests/futex/include/futex_thread.h | 114 ++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/futex/include/futex_thread.h diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/test= ing/selftests/futex/functional/Makefile index 5c1c824f97400..724e8216e41b1 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -11,7 +11,8 @@ endif =20 LOCAL_HDRS :=3D \ ../include/futextest.h \ - ../include/atomic.h + ../include/atomic.h \ + ../include/futex_thread.h TEST_GEN_PROGS :=3D \ futex_wait_timeout \ futex_wait_wouldblock \ diff --git a/tools/testing/selftests/futex/include/futex_thread.h b/tools/t= esting/selftests/futex/include/futex_thread.h new file mode 100644 index 0000000000000..49ae687012fe5 --- /dev/null +++ b/tools/testing/selftests/futex/include/futex_thread.h @@ -0,0 +1,114 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _FUTEX_THREAD_H +#define _FUTEX_THREAD_H +#include +#include +#include +#include +#include + +#define USEC_PER_SEC 1000000L +#define WAIT_THREAD_RETRIES 100 + +struct futex_thread { + pthread_t thread; + pthread_barrier_t barrier; + pid_t tid; + int (*threadfn)(void *arg); + void *arg; + int retval; +}; + +static inline int __wait_for_thread(FILE *fp, int timeout_us) +{ + char buf[80] =3D ""; + int i; + int sleep_time_us =3D timeout_us / WAIT_THREAD_RETRIES; + + if (sleep_time_us <=3D 0) + sleep_time_us =3D 1; + + for (i =3D 0; i < WAIT_THREAD_RETRIES; i++) { + if (!fgets(buf, sizeof(buf), fp)) + return -EIO; + if (!strncmp(buf, "futex", 5)) + return 0; + usleep(sleep_time_us); + rewind(fp); + } + return -ETIMEDOUT; +} + +static void *__futex_thread_fn(void *arg) +{ + struct futex_thread *t =3D arg; + + t->tid =3D gettid(); + pthread_barrier_wait(&t->barrier); + t->retval =3D t->threadfn(t->arg); + return NULL; +} + +/** + * futex_wait_for_thread - Wait for the child thread to sleep in the futex= context + * @t: Thread handle. + * @timeout_us: The timeout for waiting for the thread to enter the sleep = state. + */ +static inline int futex_wait_for_thread(struct futex_thread *t, int timeou= t_us) +{ + char fname[80]; + FILE *fp; + int res; + + snprintf(fname, sizeof(fname), "/proc/%d/wchan", t->tid); + fp =3D fopen(fname, "r"); + if (!fp) { + return -EIO; + } + + res =3D __wait_for_thread(fp, timeout_us); + fclose(fp); + return res; +} + +/** + * futex_thread_create - Create a new thread for testing. + * @t: The handle of the newly created thread. + * @threadfn: The new thread starts execution by invoking threadfn + * @arg: The parameters passed to threadfn. + */ +static inline int futex_thread_create(struct futex_thread *t, int (*thread= fn)(void *), void *arg) +{ + int ret; + + ret =3D pthread_barrier_init(&t->barrier, NULL, 2); + if (ret) + return ret; + + t->tid =3D 0; + t->threadfn =3D threadfn; + t->arg =3D arg; + + ret =3D pthread_create(&t->thread, NULL, __futex_thread_fn, t); + if (ret) { + pthread_barrier_destroy(&t->barrier); + return ret; + } + + pthread_barrier_wait(&t->barrier); + return 0; +} + +/** + * futex_thread_destroy - Wait for and reclaim the resources of the thread. + * @t: Thread handle. + */ +static inline int futex_thread_destroy(struct futex_thread *t) +{ + pthread_join(t->thread, NULL); + pthread_barrier_destroy(&t->barrier); + return t->retval; +} + +#endif --=20 2.34.1 From nobody Fri Jun 12 23:02:03 2026 Received: from out203-205-221-192.mail.qq.com (out203-205-221-192.mail.qq.com [203.205.221.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BC1540B6F6 for ; Tue, 12 May 2026 07:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.192 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778570028; cv=none; b=FyBban8W2IBwSEfl6tFl1dApJDk8Yk/hi1oYS7fmVo+h7UF7xR7swMIazsyC16qWvORdIl5bSxZGPMbQ82Ke9FPb0Jhph8Sq627Ck8X0sJkzqMbDACg+f8mnRJCUq11xRGE7i5/lzY4fLZlshLMVkTjDsXyf0OV5CQrV4a1eYBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778570028; c=relaxed/simple; bh=yG/evL3KBASYyxGp0i0hfqBAGi35HSoPB+hrGAJ0s70=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=SsQlggmoHqVTA3XURWUC8Q3YVCm8YreJktA4d3ugxtWOkEMYcAGKcIJZZNxsEGrz8LkWe2j2jqkbNvSJ2Ke2yf+leM6P3uT31SGzgwjrYMQWOiXX0B//9dfBnOGkFMyM3lUl1zHOAv+7/KOEZm4mTk2GBDXB4XXoOkAKpS6IZM0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=v6MXIQp3; arc=none smtp.client-ip=203.205.221.192 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="v6MXIQp3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1778570016; bh=RkxmsoOndnS552AiB2EhazGuZqNKHe7IJF8baLR4uzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=v6MXIQp3/z5mQ2g3PlRlFlgnXckU1Z2BsBa+1nsmAtElIJOfKuWwKf57A679lWbg6 huUQ6ShvGxSgSITxFxn6py+hVKQJ/WspPCHIDUGYCBL4nyEdtyUdh7XuDgRTNaSUlc x9KOsfnzO7BPXOHJYhXug7jO8btjFvJ4mTgM4RvI= Received: from meizu-Precision-3660.meizu.com ([112.91.84.73]) by newxmesmtplogicsvrsza53-0.qq.com (NewEsmtp) with SMTP id 360A6464; Tue, 12 May 2026 15:13:32 +0800 X-QQ-mid: xmsmtpt1778570012tcbxgdpn1 Message-ID: X-QQ-XMAILINFO: OHRxy+6QobHQHDTMR6y4sCsl8CO6APMk5qlwBdTtmmRu52MUoUZ7MNcuMmt0Lp jyL7Qxs+r2DIIRR7TowFOy3lDfZ6iosehMGvvotY+2L8GgrTrL2tLgl0SYP+4XFqPKy6MaJGpYBr Pm2eJMXHERpiepbrO13RZTERmYkKxTOUGeGG9PMc+opt7oduP/eDAiVAP3PQsEsn6PNj6ak4lRzT DG315OGAQriCFaXdGCEntvyJ2qzz9818dy5C41G5Bn1+nqHbiTWT+BPGGpwNUf6s0RZol84U/XJO KECLEYhKurJNGMSZ2yfeN0IiCMx2R9fjU5uYBqtjTRVnBPtcW6S5lUJzyQoROEts6i/Xp7exrqzy KBgzGonj1Yv96vFbjCSFxIAx+/g2wN04A6Hp7wA0nT2RNbTiLCUQ+RjNj140G2WOeb7Dy7vhSDTD 543gsHE2KnOFv2ODfgWvDUAfWKuYJUBTSrKiCVOY2GkswMbVNIK9Snk/Z/8jNtN56TgSBVcOKz4y z431AQX8IjXSvPoFZWmlQ4NjdFfsLspVKFKMNUXWWqCgPkh1kqQLHBe4aglAkVSVmpNr5/wkbBIk +Apaw6kr7waBhDmFDKQf2UjRj1g6E/aUrlYim96wYtopRQdi49XfetM1pdeGX2tRTaBnjFgA5uqo oq0NAyAezIEh1wt43uR7ZOUElH8szQZimlJY3YsGE5ZeC6VDN+UvQwf21PvqWivGDBQL6LEyX+oq UteiLwgyRTF7A5KvKwnmU53yjMQNA3taogRLRQxZr0FjD/cCQY4MSJPsoz5oK8bBpWGl+RRL5Gan l6n74h7jP7T7XRl+BBrJvxLM6e4ardNXery747St6s0kQXyiaGxH+ixkAEMA1Nt+J6uwk1+9SaFz gzmIR9dsguloXsYbXiGg78RJUuIkdXxANf1MaELNynPVyLR5FHXPSq3DUWriwCD2r+3/oqdHMI9L u1um5XEY2/wjEy7YHKrAic1S9IRF1R+Agx1PADKj//n5bIrVZodGGH26h/zI5Kekgi8ellfwIA+z TMJYN25L6QHSsTyTPGb+4OdT3itdfUpxW76xqwX2wmH2Zx1nFvZ9GWyCAGwBKNgxqXZFyHoUgKmm ccegI0AG8bUJiG4u/QK0Z7oRNEElM3WfG1xf0lSxkl/T44VzALDvTmrUauNK+74yHEPhcpS+BHCw aIi+oYQZQ3rpK5qs+fGlLaAu75qQ9URASfIfU= X-QQ-XMRINFO: NS+P29fieYNwqS3WCnRCOn9D1NpZuCnCRA== From: Yuwen Chen To: ywen.chen@foxmail.com Cc: akpm@linux-foundation.org, andrealmeid@igalia.com, bigeasy@linutronix.de, colin.i.king@gmail.com, dave@stgolabs.net, dvhart@infradead.org, edliaw@google.com, justinstitt@google.com, kernel-team@android.com, licayy@foxmail.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, luto@mit.edu, mingo@redhat.com, morbo@google.com, nathan@kernel.org, ndesaulniers@google.com, peterz@infradead.org, shuah@kernel.org, tglx@kernel.org, usama.anjum@collabora.com, wakel@google.com Subject: [PATCH v7 2/2] selftests/futex: fix the failed futex_requeue test issue Date: Tue, 12 May 2026 15:13:31 +0800 X-OQ-MSGID: <20260512071331.3106030-1-ywen.chen@foxmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This test item has extremely high requirements for timing and can only pass the test under specific conditions. The following situations will lead to test failure: MainThread Thread1 | pthread_create-------------------- | | futex_cmp_requeue | | futex_wait | | If the child thread is not waiting in the futex_wait function when the main thread reaches the futex_cmp_requeue function, the test will fail. An attempt is made to avoid this problem by checking whether the child thread is in a sleeping state in the main thread. Fixes: 7cb5dd8e2c8c ("selftests: futex: Add futex compare requeue test") Signed-off-by: Yuwen Chen Co-developed-by: Edward Liaw Signed-off-by: Edward Liaw --- v6->v7: 1. Unified error checking to `if (ret < 0)` in both requeue_single and requeue_multiple test cases. 2. Added comment explaining the break logic in requeue_multiple when /proc is not available. .../futex/functional/futex_requeue.c | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/futex/functional/futex_requeue.c b/too= ls/testing/selftests/futex/functional/futex_requeue.c index dcf0d5f2f3122..5c849ccf16e26 100644 --- a/tools/testing/selftests/futex/functional/futex_requeue.c +++ b/tools/testing/selftests/futex/functional/futex_requeue.c @@ -9,51 +9,59 @@ #include =20 #include "futextest.h" +#include "futex_thread.h" #include "kselftest_harness.h" =20 -#define timeout_ns 30000000 -#define WAKE_WAIT_US 10000 +#define FUTEX_WAIT_TIMEOUT_SECS 1 +#define WAIT_THREAD_CREATE_TIMEOUT_USECS (USEC_PER_SEC / 2) /* 500ms */ =20 volatile futex_t *f1; =20 -void *waiterfn(void *arg) +static int waiterfn(void *arg) { struct timespec to; =20 - to.tv_sec =3D 0; - to.tv_nsec =3D timeout_ns; + to.tv_sec =3D FUTEX_WAIT_TIMEOUT_SECS; + to.tv_nsec =3D 0; =20 - if (futex_wait(f1, *f1, &to, 0)) + if (futex_wait(f1, *f1, &to, 0)) { printf("waiter failed errno %d\n", errno); + return -errno; + } =20 - return NULL; + return 0; } =20 TEST(requeue_single) { + struct futex_thread waiter; volatile futex_t _f1 =3D 0; volatile futex_t f2 =3D 0; - pthread_t waiter[10]; + int ret; =20 f1 =3D &_f1; =20 /* * Requeue a waiter from f1 to f2, and wake f2. */ - ASSERT_EQ(0, pthread_create(&waiter[0], NULL, waiterfn, NULL)); + ASSERT_EQ(0, futex_thread_create(&waiter, waiterfn, NULL)); =20 - usleep(WAKE_WAIT_US); + ret =3D futex_wait_for_thread(&waiter, WAIT_THREAD_CREATE_TIMEOUT_USECS); + if (ret < 0) + usleep(WAIT_THREAD_CREATE_TIMEOUT_USECS); =20 EXPECT_EQ(1, futex_cmp_requeue(f1, 0, &f2, 0, 1, 0)); EXPECT_EQ(1, futex_wake(&f2, 1, 0)); + + EXPECT_EQ(0, futex_thread_destroy(&waiter)); } =20 TEST(requeue_multiple) { + struct futex_thread waiter[10]; volatile futex_t _f1 =3D 0; volatile futex_t f2 =3D 0; - pthread_t waiter[10]; - int i; + int i, ret; =20 f1 =3D &_f1; =20 @@ -62,12 +70,22 @@ TEST(requeue_multiple) * At futex_wake, wake INT_MAX (should be exactly 7). */ for (i =3D 0; i < 10; i++) - ASSERT_EQ(0, pthread_create(&waiter[i], NULL, waiterfn, NULL)); + ASSERT_EQ(0, futex_thread_create(&waiter[i], waiterfn, NULL)); =20 - usleep(WAKE_WAIT_US); + for (i =3D 0; i < 10; i++) { + ret =3D futex_wait_for_thread(&waiter[i], WAIT_THREAD_CREATE_TIMEOUT_USE= CS / 10); + if (ret < 0) { + /* /proc not available, give all threads time to enter futex wait */ + usleep(WAIT_THREAD_CREATE_TIMEOUT_USECS); + break; + } + } =20 EXPECT_EQ(10, futex_cmp_requeue(f1, 0, &f2, 3, 7, 0)); EXPECT_EQ(7, futex_wake(&f2, INT_MAX, 0)); + + for (i =3D 0; i < 10; i++) + EXPECT_EQ(0, futex_thread_destroy(&waiter[i])); } =20 TEST_HARNESS_MAIN --=20 2.34.1