tools/perf/util/mutex.h
Source file repositories/reference/linux-study-clean/tools/perf/util/mutex.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/mutex.h- Extension
.h- Size
- 4474 bytes
- Lines
- 130
- 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
pthread.hstdbool.h
Detected Declarations
struct cond
Annotated Snippet
struct cond {
pthread_cond_t cond;
};
/* Default initialize the mtx struct. */
void mutex_init(struct mutex *mtx);
/*
* Initialize the mtx struct and set the process-shared rather than default
* process-private attribute.
*/
void mutex_init_pshared(struct mutex *mtx);
/* Initializes a mutex that may be recursively held on the same thread. */
void mutex_init_recursive(struct mutex *mtx);
void mutex_destroy(struct mutex *mtx);
void mutex_lock(struct mutex *mtx) EXCLUSIVE_LOCK_FUNCTION(*mtx);
void mutex_unlock(struct mutex *mtx) UNLOCK_FUNCTION(*mtx);
/* Tries to acquire the lock and returns true on success. */
bool mutex_trylock(struct mutex *mtx) EXCLUSIVE_TRYLOCK_FUNCTION(true, *mtx);
/* Default initialize the cond struct. */
void cond_init(struct cond *cnd);
/*
* Initialize the cond struct and specify the process-shared rather than default
* process-private attribute.
*/
void cond_init_pshared(struct cond *cnd);
void cond_destroy(struct cond *cnd);
void cond_wait(struct cond *cnd, struct mutex *mtx) EXCLUSIVE_LOCKS_REQUIRED(mtx);
void cond_signal(struct cond *cnd);
void cond_broadcast(struct cond *cnd);
#endif /* __PERF_MUTEX_H */
Annotation
- Immediate include surface: `pthread.h`, `stdbool.h`.
- Detected declarations: `struct cond`.
- 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.