---
name: "PAPI_lock"
section: "3"
platform: "linux"
package: "libpapi-dev"
version: "7.1.0-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PAPI_lock"
---

# PAPI\_lock(3)

Lock one of two mutex variables defined in papi.h.

## NAME

PAPI\_lock - Lock one of two mutex variables defined in **papi.h**.

## SYNOPSIS

## Detailed Description

**PAPI\_lock()** grabs access to one of the two PAPI mutex variables. This function is provided to the user to have a platform independent call to a (hopefully) efficiently implemented mutex.

**C Interface:**

\#include \<**papi.h**\> \
 void **PAPI\_lock(int lock)**;

**Parameters**

*lock* -- an integer value specifying one of the two user locks: PAPI\_USR1\_LOCK or PAPI\_USR2\_LOCK

**Returns**

There is no return value for this call. Upon return from **PAPI\_lock** the current thread has acquired exclusive access to the specified PAPI mutex.

**See also**

**PAPI\_unlock**

**PAPI\_thread\_init**

## Author

Generated automatically by Doxygen for PAPI from the source code.
