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.

Dependency Surface

Detected Declarations

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

Implementation Notes