[libc-commits] [libc] [llvm] [libc] Implement pthread_cleanup_push and pthread_cleanup_pop (PR #223427)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Mon Sep 14 10:54:17 PDT 2026


================
@@ -108,12 +109,14 @@ struct alignas(STACK_ALIGNMENT) ThreadAttributes {
   ThreadAtExitCallbackMgr *atexit_callback_mgr;
   void *platform_data;
   cpp::Atomic<ThreadAttributes *> joiner;
+  __pthread_cleanup_frame *cleanup_stack;
----------------
SchrodingerZhu wrote:

could you make this an explicit stack:

```
class CleanupStack {
    void push(Frame*);
    void pop();
};
```

https://github.com/llvm/llvm-project/pull/223427


More information about the libc-commits mailing list