[libc-commits] [libc] [libc] Mutex implementation for single-threaded baremetal (PR #145358)

Daniel Thornburgh via libc-commits libc-commits at lists.llvm.org
Mon Jun 23 11:22:35 PDT 2025


mysterymath wrote:

>We currently aren't, because we just lock the interface... Doesn't that mean that if an atexit handler calls atexit it'll deadlock?

It shouldn't; the implementation explicitly unlocks the stack before calling a handler:
https://github.com/llvm/llvm-project/blob/0f173a0f9af54a3117657135cd23e079c3c626ad/libc/src/stdlib/exit_handler.h#L53

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


More information about the libc-commits mailing list