[libc-commits] [libc] [libc] Mutex implementation for single-threaded baremetal (PR #145358)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Mon Jun 23 10:46:09 PDT 2025
jhuber6 wrote:
> > I've been considering if it's possible to just make `atexit` lock free. it would be pretty easy if we defined what happens when one thread calls `atexit()` while someone is consuming it. Easy mode is that we ignore any attempt to modify after exit is already happening. Hard mode is allowing it to interject and calling it as well.
>
> That would conflict with the C standard, right?
```
7.24.4.2.2
The atexit function registers the function pointed to by func, to be called without arguments at
normal program termination.363) It is unspecified whether a call to the atexit function that does
not happen before the exit function is called will succeed.
```
https://github.com/llvm/llvm-project/pull/145358
More information about the libc-commits
mailing list