---
name: "pthread_cleanup_pop"
section: "3"
platform: "macos"
package: "libpthread"
version: "539.100.4"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pthread_cleanup_pop"
---

# pthread\_cleanup\_pop(3)

call the first cleanup routine

## NAME

**pthread\_cleanup\_pop** – call the first cleanup routine

## SYNOPSIS

**#include \<pthread.h\>**

*void*\

**pthread\_cleanup\_pop**(*int execute*);

## DESCRIPTION

The **pthread\_cleanup\_pop**() function pops the top cleanup routine off of the current threads cleanup routine stack, and, if *execute* is non-zero, it will execute the function. If there is no cleanup routine then **pthread\_cleanup\_pop**() does nothing.

The **pthread\_cleanup\_pop**() function is implemented as a macro that closes a block. Invocations of this function must appear as standalone statements that are paired with an earlier call of [pthread\_cleanup\_push(3)](/pthread_cleanup_push/3.md) in the same lexical scope.

## RETURN VALUES

The **pthread\_cleanup\_pop**() function does not return any value.

## ERRORS

None

## SEE ALSO

[pthread\_cleanup\_push(3)](/pthread_cleanup_push/3.md), [pthread\_exit(3)](/pthread_exit/3.md)

## STANDARDS

The **pthread\_cleanup\_pop**() function conforms to ISO/IEC 9945-1:1996 (“POSIX.1”).
