tools/testing/selftests/futex/functional/futex_requeue_pi.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/futex/functional/futex_requeue_pi.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/futex/functional/futex_requeue_pi.c- Extension
.c- Size
- 10417 bytes
- Lines
- 401
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
errno.hlimits.hpthread.hstdio.hstdlib.hsignal.hstring.hatomic.hfutextest.hkselftest_harness.h
Detected Declarations
struct thread_argfunction create_rt_thread
Annotated Snippet
struct thread_arg {
long id;
struct timespec *timeout;
int lock;
int ret;
};
#define THREAD_ARG_INITIALIZER { 0, NULL, 0, 0 }
FIXTURE(args)
{
};
FIXTURE_SETUP(args)
{
};
FIXTURE_TEARDOWN(args)
{
};
FIXTURE_VARIANT(args)
{
long timeout_ns;
bool broadcast;
bool owner;
bool locked;
};
/*
* For a given timeout value, this macro creates a test input with all the
* possible combinations of valid arguments
*/
#define FIXTURE_VARIANT_ADD_TIMEOUT(timeout) \
\
FIXTURE_VARIANT_ADD(args, t_##timeout) \
{ \
.timeout_ns = timeout, \
}; \
\
FIXTURE_VARIANT_ADD(args, t_##timeout##_broadcast) \
{ \
.timeout_ns = timeout, \
.broadcast = true, \
}; \
\
FIXTURE_VARIANT_ADD(args, t_##timeout##_broadcast_locked) \
{ \
.timeout_ns = timeout, \
.broadcast = true, \
.locked = true, \
}; \
\
FIXTURE_VARIANT_ADD(args, t_##timeout##_broadcast_owner) \
{ \
.timeout_ns = timeout, \
.broadcast = true, \
.owner = true, \
}; \
\
FIXTURE_VARIANT_ADD(args, t_##timeout##_locked) \
{ \
.timeout_ns = timeout, \
.locked = true, \
}; \
\
FIXTURE_VARIANT_ADD(args, t_##timeout##_owner) \
{ \
.timeout_ns = timeout, \
.owner = true, \
}; \
FIXTURE_VARIANT_ADD_TIMEOUT(0);
FIXTURE_VARIANT_ADD_TIMEOUT(5000);
FIXTURE_VARIANT_ADD_TIMEOUT(500000);
FIXTURE_VARIANT_ADD_TIMEOUT(2000000000);
int create_rt_thread(pthread_t *pth, void*(*func)(void *), void *arg,
int policy, int prio)
{
int ret;
struct sched_param schedp;
pthread_attr_t attr;
pthread_attr_init(&attr);
memset(&schedp, 0, sizeof(schedp));
ret = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
if (ret) {
ksft_exit_fail_msg("pthread_attr_setinheritsched\n");
return -1;
Annotation
- Immediate include surface: `errno.h`, `limits.h`, `pthread.h`, `stdio.h`, `stdlib.h`, `signal.h`, `string.h`, `atomic.h`.
- Detected declarations: `struct thread_arg`, `function create_rt_thread`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.